Hi all. I need to customize my email sending, so I can't use the standard lists. I track the emails I need to send to in a database and use System.Web.Mail.MailMessage class from an aspx page on my site to send them.
It works fine just using the local Smtp server, except I get blocked by all the big people (hotmail, gmail, yahoo, etc). Is there a way I can use my actual relay server to send the mails, instead of just the local smtp server on the web server?
I tried setting the SmtServer for SmtpMail to my relay (see C# code below), but then all mails fail since I don't have access to send from the relay server. Is there a way to make this work?
Thanks,
Keith
Code:
MailMessage msg = new MailMessage();
msg.From = fromEmail
msg.Subject = subject;
msg.To = toEmail;
msg.Body = body;
msg.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = "mail2.jodoshared.com";
SmtpMail.Send(msg);
It works fine just using the local Smtp server, except I get blocked by all the big people (hotmail, gmail, yahoo, etc). Is there a way I can use my actual relay server to send the mails, instead of just the local smtp server on the web server?
I tried setting the SmtServer for SmtpMail to my relay (see C# code below), but then all mails fail since I don't have access to send from the relay server. Is there a way to make this work?
Thanks,
Keith
Code:
MailMessage msg = new MailMessage();
msg.From = fromEmail
msg.Subject = subject;
msg.To = toEmail;
msg.Body = body;
msg.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = "mail2.jodoshared.com";
SmtpMail.Send(msg);