Steps to send an email from ASP.NET application
-
Hi All, I have developed an ASP.NET application to send emails. I have followed the coding steps to create the application. But however, the mail is not getting delivered to the destination ID. Can anyone help me in giving details about all the steps to be done before running the application. A sample application would be more helpful. Thanks in advance, Murali
-
Hi All, I have developed an ASP.NET application to send emails. I have followed the coding steps to create the application. But however, the mail is not getting delivered to the destination ID. Can anyone help me in giving details about all the steps to be done before running the application. A sample application would be more helpful. Thanks in advance, Murali
What you have coded for the SMTP? And what error it shows? Did the Norton blocking you in sending the mails?
Regards, Satips.
-
What you have coded for the SMTP? And what error it shows? Did the Norton blocking you in sending the mails?
Regards, Satips.
Hi, Thanks for the reply. If i set the SMTP Server name in the code as "smtp.gmail.com"(example), then i get the 'Could not access(CDO.Message) object' error message. However, if i set it as 'localhost' then the email is redirected to the 'Queue' folder under the /Inetpub/mailroot. Do i need to do any more settings? Thanks in advance, Murali
-
Hi, Thanks for the reply. If i set the SMTP Server name in the code as "smtp.gmail.com"(example), then i get the 'Could not access(CDO.Message) object' error message. However, if i set it as 'localhost' then the email is redirected to the 'Queue' folder under the /Inetpub/mailroot. Do i need to do any more settings? Thanks in advance, Murali
(1)Specify a valid mail server for the SmtpMail.SmtpServer property. If that property is not set, at least set it to 127.0.0.1. For example: SmtpMail.SmtpServer = "127.0.0.1" (2)If you are using "localhost" or "127.0.0.1" as the SmtpMail.SmtpServer, you may not have permissions to relay through the IIS SMTP Service. To allow access, open up the IIS Admin MMC. Locate the SMTP Virtual Server, and right-click, then select Properties. On the Access tab, click the Relay button. In the Relay Restrictions dialog, grant your IP address (127.0.0.1) to the Computers listbox. Close down all dialogs, and restart the SMTP Service. (3)If you are using "localhost" or "127.0.0.1" as the SmtpMail.SmtpServer, make sure Anonymous access is allowd. To allow access, open up the IIS Admin MMC. Locate the SMTP Virtual Server, and right-click, then select Properties. On the Access tab, click the Authentication button. Be sure "Anonymous Access" is the only checkbox checked. Close down all dialogs, and restart the SMTP Service. (4)The email address does not have a valid TO address. After iterating through the InnerExceptions, you may find this error message actually has to do with relaying. Try sending a test email to an email address that exists on the server specified by SmtpMail.SmtpServer. If you can send an email to that server, then it is a relay issue. Talk to your mail server administrator about letting your code relay through the mail server. (5)Use a real FROM address that exists on the SmtpMail.SmtpServer. Do not use something like "asdf@asdf.com", or some other bogus address as your MailMessage.FromProperty. More advanced mail servers will catch this, and will deny relaying.
Regards, Satips.
-
(1)Specify a valid mail server for the SmtpMail.SmtpServer property. If that property is not set, at least set it to 127.0.0.1. For example: SmtpMail.SmtpServer = "127.0.0.1" (2)If you are using "localhost" or "127.0.0.1" as the SmtpMail.SmtpServer, you may not have permissions to relay through the IIS SMTP Service. To allow access, open up the IIS Admin MMC. Locate the SMTP Virtual Server, and right-click, then select Properties. On the Access tab, click the Relay button. In the Relay Restrictions dialog, grant your IP address (127.0.0.1) to the Computers listbox. Close down all dialogs, and restart the SMTP Service. (3)If you are using "localhost" or "127.0.0.1" as the SmtpMail.SmtpServer, make sure Anonymous access is allowd. To allow access, open up the IIS Admin MMC. Locate the SMTP Virtual Server, and right-click, then select Properties. On the Access tab, click the Authentication button. Be sure "Anonymous Access" is the only checkbox checked. Close down all dialogs, and restart the SMTP Service. (4)The email address does not have a valid TO address. After iterating through the InnerExceptions, you may find this error message actually has to do with relaying. Try sending a test email to an email address that exists on the server specified by SmtpMail.SmtpServer. If you can send an email to that server, then it is a relay issue. Talk to your mail server administrator about letting your code relay through the mail server. (5)Use a real FROM address that exists on the SmtpMail.SmtpServer. Do not use something like "asdf@asdf.com", or some other bogus address as your MailMessage.FromProperty. More advanced mail servers will catch this, and will deny relaying.
Regards, Satips.
Hi, I followed your steps. I send a sample mail to an ID existing in the local SMTP Server and the delivery was a SUCCESS. However, if i try to send the mail to a different ID say hello@gmail.com, then i get a delivery fail message in the 'Drop' folder of the 'mailroot' folder. Do i need to enable some options in the destination SMTP Server to recieve mails from my machine?
Thanks in advance, Murali