Is there a way I can send an email with a different mime and smtp address? The MailMessage does not seem to support this.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
What Kevin is talking about is that he wants the message itself to contain a different set of addresses in the headers than who the message is actually sent from (or to).
For example, in the message headers, you might have:
But you might connect to the SMTP server and use
jill@thehill.com
.This can be useful if you have an alias set up that simply redirects to your other address but the SMTP server will only accept messages sent from an email address in its own domain (I think GMail has this restriction).
It's also useful when sending to undisclosed recipients.
That said... you may want to look into using my MimeKit and MailKit libraries for .NET.
MimeKit handles constructing and parsing of email messages while MailKit has all of the logic for SMTP, POP3, and IMAP.
What you can do is construct the MimeMessage with any email addresses that you'd like and then use:
Hope that helps.