/ Published in: C#
For both gmail and gApps, use smtp.gmail.com on port 25 with SSL and NetworkCredentials.
Neither can send email to their own address, but they can send to other addresses.
[NLog](http://nlog-project.org/) has [an example](http://nlog-project.org/wiki/Using_NLog_with_GMail) of how to automatically send emails in order to log info from an app.
Neither can send email to their own address, but they can send to other addresses.
[NLog](http://nlog-project.org/) has [an example](http://nlog-project.org/wiki/Using_NLog_with_GMail) of how to automatically send emails in order to log info from an app.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
string host = "smtp.gmail.com"; int port; //port = 587; // with TLS //port = 465; // with SSL port = 25; // normal - works for my gmail account with enableSSL { Subject = "subject", Body = "body", }; EnableSsl = true, Timeout = 30000, }; try { smtp.Send(message); } catch(SmtpException se) { //log } message.Dispose();