login about faq


I'm using the smtp component to send out emails both via smtp relays and also directly via mxlookup. The latter is only used in those cases where the server is on a fixed ip and it's own MX records point to that IP so spam filters aren't an issue. We have one problem when sending out directly (mxlookup): If there are two or more recipients in the email we send the email to each of the recipient mx servers by modifying the mailman.SmtpHost property in turn. But when we call SendEmail the target smtp server gets ALL the recipients of the email as the RCPT TO: Envelope recipients and of course rejects those addresses that aren't in the domain of that server. Q: Is there a way to send an email to a specific recipient only WITHOUT modifying the TO:, CC:, etc. mail headers? We need to preserve the headers as they are with all the recipients in.

asked Jan 07 '13 at 06:08

clausc's gravatar image


Call the SendMime method instead of SendEmail. The SendMime method allows you to pass the MIME in one argument, and the "RCPT TO" addresses in another argument.

Also, the mailman.SendEmail method is equivalent to the following (pseudo-code)

mimeStr = mailman.RenderToMime(emailObject);
success = mailman.SendMime(fromAddr, recipients, mimeStr);


answered Jan 07 '13 at 08:42

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jan 07 '13 at 06:08

Seen: 1,451 times

Last updated: Jan 07 '13 at 08:42

powered by OSQA