Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
625 Points
216 Posts
Feb 23, 2012 08:01 AM|LINK
Hi,
Try this functions
try { // Create a new blank MailMessage MailMessage email = new MailMessage(); email.BodyFormat = MailFormat.Html; email.From = "from@mydomain.com"; email.To = "to@mydomain.com"; email.Subject = "test"; email.Body = "bodycontents"; // Set the SMTP server and send the email SmtpMail.SmtpServer = "localhost"; SmtpMail.Send (email); lblMessage.Text = "Your email has been sent"; } catch(Exception ex) { lblMessage.Text = ex.ToString(); }
dinakaran
Member
625 Points
216 Posts
Re: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for (email address).
Feb 23, 2012 08:01 AM|LINK
Hi,
Try this functions
try { // Create a new blank MailMessage MailMessage email = new MailMessage(); email.BodyFormat = MailFormat.Html; email.From = "from@mydomain.com"; email.To = "to@mydomain.com"; email.Subject = "test"; email.Body = "bodycontents"; // Set the SMTP server and send the email SmtpMail.SmtpServer = "localhost"; SmtpMail.Send (email); lblMessage.Text = "Your email has been sent"; } catch(Exception ex) { lblMessage.Text = ex.ToString(); }