views:

2059

answers:

2

Hi,

When you send an email using System.Net.Mail you can set the SMTP MAIL FROM envelope by using the MailMessage.Sender Property.
If you set the smtp network deliveryMethod property to be "Network", the MAIL FROM envelope is set using the Sender value.
If you set the smtp network deliveryMethod property to be "PickupDirectoryFromIis", the MAIL FROM envelope uses the MailMessage.From property instead of the Sender one.

I need to keep PickupDirectoryFromIis as my deliveryMethod for performance concern.

Any suggestion how to keep the value I need for the SMTP MAIL FROM envelope?

Thanks in advance.

A: 

What about if you use:

  <smtp deliveryMethod="SpecifiedPickupDirectory" from="[email protected]">
    <specifiedPickupDirectory pickupDirectoryLocation="c:\Temp\Mail" />
  </smtp>

??

Eduardo Molteni
Yes, what about it?
bzlm
@bzlm: You are talking to me?
Eduardo Molteni
+1  A: 

Reported as a bug: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=483878

Richard
Thanks Richard, I should have done this a while ago.
Nip
The bug report has just been updated:"Fix will appear in a future release of the .Net framework."
Richard
Thanks for the info; the "appear in a future release" does not sound like we are going to have the fix soon :(
Nip
I've just tested this in .NET 4.0 RTM, and it looks like it's fixed. Shame they couldn't fix it for 3.5, but I guess they're too busy playing with the new toys to worry about "old" framework versions.
Richard