Hi, We have a website that we understand to be .net4 and C#. As you can tell I know nothing much about these things.
However we seem to have a problem that the person that makes our website and the hosting company seem to just pass the buck....
Our website is www.caravanholidaylets.co.uk. On here we have a contact form that visitors can use to contact our advertisers. The problem is that sometimes the advertiser gets the email, sometimes its hours
late or days late, or it never arrives. I have one of our email addresses as the BCC and that comes instantly.
When I test the system I send to 3 different test adverts with 3 different email addresses, And they are all like described above. Irrattic.
What could be causing this to happen, our advertisers are getting upset a little. Any ideas?
Crispin02
Member
3 Points
2 Posts
Help Needed.
Feb 23, 2012 09:23 AM|LINK
Hi, We have a website that we understand to be .net4 and C#. As you can tell I know nothing much about these things.
However we seem to have a problem that the person that makes our website and the hosting company seem to just pass the buck....
Our website is www.caravanholidaylets.co.uk. On here we have a contact form that visitors can use to contact our advertisers. The problem is that sometimes the advertiser gets the email, sometimes its hours late or days late, or it never arrives. I have one of our email addresses as the BCC and that comes instantly.
When I test the system I send to 3 different test adverts with 3 different email addresses, And they are all like described above. Irrattic.
What could be causing this to happen, our advertisers are getting upset a little. Any ideas?
Sum8
Contributor
4141 Points
931 Posts
Re: Help Needed.
Feb 23, 2012 09:54 AM|LINK
Is this happening with specific email ids only or any email id?
Check your SMTP server is configured properly and it is delivering the mails instantly.
Sumit Pathak
------------------
ThisPost = Helped == True ? "Mark As Answer" : "Elaborate your problem in more details"
Crispin02
Member
3 Points
2 Posts
Re: Help Needed.
Feb 23, 2012 10:03 AM|LINK
I think this is how the code for the email looks:
{
System.Net.Mail.
SmtpClient smtp = new System.Net.Mail.SmtpClient("localhost");
System.Net.Mail.
MailMessage message = new System.Net.Mail.MailMessage("no-reply@" + Request.Url.Host, item.user.email.Contains("@") ? item.user.email : "test@agmonks.co.uk");
message.Subject =
"New Message from www.caravanholidaylets.co.uk";
message.Bcc.Add(
"info@caravanholidaylets.co.uk");
string text = "<table>";
text += emailrow(
"Name",txtName.Text);
text += emailrow(
"Email", txtEmail.Text);
text += emailrow(
"Telephone", txtTelephone.Text);
if (item.uidlistingtype == 1)
{
text += emailrow(
"Date From", txtDateFrom.Text);
text += emailrow(
"Date To", txtDateTo.Text);
}
text += emailrow(
"Message", txtMessage.Text);
text +=
"</table>";
message.IsBodyHtml =
true;
message.Body = text;
smtp.Send(message);
}
private string emailrow(string text, string value)
{
return string.Format("<tr><td>{0}</td><td>{1}</td></tr>",text,Server.HtmlEncode(value));
}
Sum8
Contributor
4141 Points
931 Posts
Re: Help Needed.
Feb 24, 2012 04:20 AM|LINK
Check whether after sending an email through application, the email is being queued in the SMTP server's queue.
You can check this at location "C:\Inetpub\mailroot\Queue".
Sumit Pathak
------------------
ThisPost = Helped == True ? "Mark As Answer" : "Elaborate your problem in more details"