Problem:
How do I configure Arvixe server to send email from my website
Solution:
System.Net.Mail.MailMessage eMail = new System.Net.Mail.MailMessage();
eMail.IsBodyHtml = true;
eMail.Body = body;
eMail.From = new System.Net.Mail.MailAddress(fromEmail);
eMail.To.Add(toEmail);
eMail.Subject = subject;
System.Net.Mail.SmtpClient SMTP = new System.Net.Mail.SmtpClient();
SMTP.Credentials = new System.Net.NetworkCredential("user","pass");
SMTP.Host = "localhost";
SMTP.Send(eMail);
Source
http://forum.arvixe.com/smf/programming-questions-tutorials/how-to-send-asp-net-email-using-system-net-mail/
This missive records my trials and tribulations as I code my way through projects. Fix the problem once and reuse the solution!
Showing posts with label smtpclient. Show all posts
Showing posts with label smtpclient. Show all posts
Tuesday, May 13, 2014
Friday, May 9, 2014
How to configure SMTP client to post to directory
Problem:
Needed to set up a webform to post email to a directory vice sending the email.
It is pretty straightforward.
Solution:
var smtpClient = new SmtpClient();
//Specify the delivery method as pickup
smtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
//Specify folder for the pickup.
smtpClient.PickupDirectoryLocation = pickupFolder;
Source:
Subscribe to:
Posts (Atom)