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?
Ugh… I just needed to post to finally figure it out I guess…
For those reading this with the same problem, you use the realy server (or your own mail.MyDomain.com) and then you authenticate against the Smtp server using MailMessage fields:
Thanks for that. I didn’t realise that could be done with .NET 1.1 although now that I know what to look for, I see that its even in the .NET docs as an example for the MailMessage.Fields property.
FYI, .NET 2.0 has a new namespace, System.Net.Mail, for sending email with lots of functionality, including the authentication.