Thursday, March 29, 2012

SMTP Email

Hi i have a silly problem ... i have a form where in the user fills his personal info and a welcome email is sent to him on submission. Now my email sending function is somewhat like below.

now the problem is the emails goto many accounts but does not goto some... it goes to email addresses like ...@dotnet.itags.org.yahoo.com, ...@dotnet.itags.org.hotmail.com, but not to ...@dotnet.itags.org.rediffmail.com ,...@dotnet.itags.org.ilocus.com,

i am in a fix y is this happenning .. is there any problem with my code or hosting server and what can be the problem .. i am not able to figure it out that is it hosting server problem or code malfunction.

Again if i send the email from the webmail account of my server they go very fine.

Is there any better way to implement this code

private bool sendMailToClient()
{
try
{
MailMessage emailMsg = new MailMessage();
String emailStr = "";

emailMsg.To = "ibuch@dotnet.itags.org.rediffmail.com";
emailMsg.Subject = "Your Registration";
emailMsg.From = "support@dotnet.itags.org.voip24x7.com";
emailMsg.Body = "some body message";

SmtpMail.SmtpServer = [ip address of the smtp server]; // e.g "66.100.110.1"
SmtpMail.Send(emailMsg);

return true;
}
catch(Exception ex)
{
message_lbl.Text = ex.Message;
return false;
}
}

Thanks
imranI've heard about similar problems in the past. Do you get an error when sending to those domains? If not, it might well be they are running spam filters (or the enduser is), blocking your mails.

0 comments:

Post a Comment