Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Write code to send e-mail from an ASP.NET application?

dot net training online

This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 ranitupe

ranitupe

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 03 January 2019 - 09:33 PM

I write the following code is this right or their need any changes..

 

MailMessage mailMess = new MailMessage ();

mailMess.From = "abc@gmail.com";
mailMess.To = "xyz@gmail.com";
mailMess.Subject = "Test email";
mailMess.Body = "Hi This is a test mail.";
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send (mailMess);

 

Please do suggest as I am beginner in this field so need some guidance






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download