problem in sending SMTP mail
-
i am using Visual Studio 2005 and i'm using the following code to send mail:- try { MailMessage mail = new MailMessage(); mail.To = varunmcaju@gmail.com; mail.From = varun_mcaju@rediffmail.com; mail.Body = "Sending mail through .NET SMTP mail"; SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mail); MessageBox.Show("Mail sent successfully"); } catch (Exception ex) { MessageBox.Show(ex.Message); } when i run this code it gives no error ...but the mail is never delivered. Then i checked the C:\Inetpub\mailroot\Queue folder and found the following message "This is an automatically generated Delivery Status Notification. Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server. varunmcaju@gmail.com " why is it unable to connect to the destination server :~...any ideas? thanks in advance
-
i am using Visual Studio 2005 and i'm using the following code to send mail:- try { MailMessage mail = new MailMessage(); mail.To = varunmcaju@gmail.com; mail.From = varun_mcaju@rediffmail.com; mail.Body = "Sending mail through .NET SMTP mail"; SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mail); MessageBox.Show("Mail sent successfully"); } catch (Exception ex) { MessageBox.Show(ex.Message); } when i run this code it gives no error ...but the mail is never delivered. Then i checked the C:\Inetpub\mailroot\Queue folder and found the following message "This is an automatically generated Delivery Status Notification. Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server. varunmcaju@gmail.com " why is it unable to connect to the destination server :~...any ideas? thanks in advance
MailMessage objEmail = new MailMessage(); objEmail.To = txtTo.Text; objEmail.From = txtFrom.Text; objEmail.Cc = txtCc.Text; objEmail.Subject = "Test Email"; objEmail.Body = txtName.Text + ", " + txtComments.Text; objEmail.Priority = MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try{ SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You"); } catch (Exception exc){ Response.Write("Send failure: " + exc.ToString()); }
SSK. Anyone who says sunshine brings happiness has never danced in the rain.
-
MailMessage objEmail = new MailMessage(); objEmail.To = txtTo.Text; objEmail.From = txtFrom.Text; objEmail.Cc = txtCc.Text; objEmail.Subject = "Test Email"; objEmail.Body = txtName.Text + ", " + txtComments.Text; objEmail.Priority = MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try{ SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You"); } catch (Exception exc){ Response.Write("Send failure: " + exc.ToString()); }
SSK. Anyone who says sunshine brings happiness has never danced in the rain.
thanks for the reply SSK :) , but there's not much of a difference between my code and your code .What i wanted to know was that why is the mail not being sent?
-
MailMessage objEmail = new MailMessage(); objEmail.To = txtTo.Text; objEmail.From = txtFrom.Text; objEmail.Cc = txtCc.Text; objEmail.Subject = "Test Email"; objEmail.Body = txtName.Text + ", " + txtComments.Text; objEmail.Priority = MailPriority.High; //SmtpMail.SmtpServer = "localhost"; try{ SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You"); } catch (Exception exc){ Response.Write("Send failure: " + exc.ToString()); }
SSK. Anyone who says sunshine brings happiness has never danced in the rain.
What was your point of sending the code. I see no difference between the two except that his is for Windows and yours in Web. :omg:
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
i am using Visual Studio 2005 and i'm using the following code to send mail:- try { MailMessage mail = new MailMessage(); mail.To = varunmcaju@gmail.com; mail.From = varun_mcaju@rediffmail.com; mail.Body = "Sending mail through .NET SMTP mail"; SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mail); MessageBox.Show("Mail sent successfully"); } catch (Exception ex) { MessageBox.Show(ex.Message); } when i run this code it gives no error ...but the mail is never delivered. Then i checked the C:\Inetpub\mailroot\Queue folder and found the following message "This is an automatically generated Delivery Status Notification. Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server. varunmcaju@gmail.com " why is it unable to connect to the destination server :~...any ideas? thanks in advance
varun_mca_ju wrote:
Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server.
Code is perfect and I do not see any changes desired. Seems like your SMTP Server is not properly configured.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
varun_mca_ju wrote:
Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server.
Code is perfect and I do not see any changes desired. Seems like your SMTP Server is not properly configured.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
thanks for the reply Manas..my SMTP settings are as follows : General-> IP Address -> [All Unassigned] Access->Relay->Relay Restrictions->Only the list below->access granted to 127.0.0.1 and also to the IP address of my computer, also the SMTP server is running....do i have to make any changes to the configuration?
-
thanks for the reply Manas..my SMTP settings are as follows : General-> IP Address -> [All Unassigned] Access->Relay->Relay Restrictions->Only the list below->access granted to 127.0.0.1 and also to the IP address of my computer, also the SMTP server is running....do i have to make any changes to the configuration?
It sounds like your mail server is not registered in DNS and servers outside your domain cannot do a reverse DNS lookup on it. This is a common method of preventing spam from spoofed mail server addresses. Register the name in DNS (MX record) with your ISP and the problem should go away.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
i am using Visual Studio 2005 and i'm using the following code to send mail:- try { MailMessage mail = new MailMessage(); mail.To = varunmcaju@gmail.com; mail.From = varun_mcaju@rediffmail.com; mail.Body = "Sending mail through .NET SMTP mail"; SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mail); MessageBox.Show("Mail sent successfully"); } catch (Exception ex) { MessageBox.Show(ex.Message); } when i run this code it gives no error ...but the mail is never delivered. Then i checked the C:\Inetpub\mailroot\Queue folder and found the following message "This is an automatically generated Delivery Status Notification. Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server. varunmcaju@gmail.com " why is it unable to connect to the destination server :~...any ideas? thanks in advance
Does your ISP allow sending mail using your own SMTP server? It's not uncommon that the port is blocked to prevent spam, in that case you have to use the SMTP server that the ISP provides instead.
Despite everything, the person most likely to be fooling you next is yourself.
-
i am using Visual Studio 2005 and i'm using the following code to send mail:- try { MailMessage mail = new MailMessage(); mail.To = varunmcaju@gmail.com; mail.From = varun_mcaju@rediffmail.com; mail.Body = "Sending mail through .NET SMTP mail"; SmtpMail.SmtpServer = "127.0.0.1"; SmtpMail.Send(mail); MessageBox.Show("Mail sent successfully"); } catch (Exception ex) { MessageBox.Show(ex.Message); } when i run this code it gives no error ...but the mail is never delivered. Then i checked the C:\Inetpub\mailroot\Queue folder and found the following message "This is an automatically generated Delivery Status Notification. Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server. varunmcaju@gmail.com " why is it unable to connect to the destination server :~...any ideas? thanks in advance
same problem has occured with me but the next day i have found that mail is sent.wait for a while..... ;)
Maniiiiiiiiiiiiiii