Find this post interesting? Do you like interesting things? Maybe you would like my invention, a connectible candle called a WickBrick!
Get one here http://wickbrick.etsy.com/
Need to create a MailAddress….. grrr
http://msdn.microsoft.com/en-us/library/system.net.mail.mailaddress.aspx
And if you want to convert from text inside of a textbox control to a MailAddress you need to use the .text property i.e.
Dim fromUser As New MailAddress(from_txt.Text)
The specified string is not in the form required for an e-mail address.
code:
public static void SendMail(string from, string to, string subject, string body)
{
// Configure mail client (may need additional
// code for authenticated SMTP servers)
SmtpClient mailClient = new SmtpClient(BalloonShopConfiguration.MailServer);
// Create the mail message
MailMessage mailMessage = new MailMessage(from, to, subject, body);
// Send mail
mailClient.Send(mailMessage);
}
public static void SendErrorLogEmail(Exception ex)
{
string from = “BalloonShop Error Report”;
string to = BalloonShopConfiguration.ErrorLogEmail;
string subject = “BalloonShop Error Generated at ” + DateTime.Now.ToShortDateString();
string body = ex.Message + “\n\n” + “Stack trace:\n” + ex.StackTrace.ToString();
SendMail(from, to, subject, body);
}
This page has a good C# example
http://msdn.microsoft.com/en-us/library/system.net.mail.mailaddress.aspx
please help for the above error
After reading through the article, I feel that I need more information on the topic. Can you suggest some resources ?