Guest User

Untitled

a guest
Aug 26th, 2018
624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. email from someaddress@company.com in asp.net using gmail SMTP authentication
  2. msg.From = new MailAddress(gMailAccount);
  3.  
  4. NetworkCredential loginInfo = new NetworkCredential(gMailAccount, password)
  5.  
  6. <mailSettings>
  7. <smtp from="someone@companyname.com">
  8. <network enableSsl="false" host="smtp.gmail.com"
  9. password="secretone" port="25" userName="user@gmail.com" />
  10. </smtp>
  11. </mailSettings>
  12.  
  13. var smtp = new SmtpClient();
  14. smtp.Send(new MailMessage("someone@companyname.com", "to@domain.com")
  15. {
  16. IsBodyHtml = true,
  17. Subject = "Some subject",
  18. Body = "add html code here"
  19. });
Add Comment
Please, Sign In to add comment