For Programmers: Free Programming Magazines  


Home > Archive > C# > April 2006 > send mass mail and have bounces to go back to different address









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author send mass mail and have bounces to go back to different address
SharpSmith@gmail.com

2006-04-12, 4:01 am

hi all
i have a very specific question regarding emails sending and googling
doesn't help me
is a way exists to send email using .NET framework (System.Web.Mail or
something else)
and have the "from" address to be X
but if the message is bounced from not existing address or whatever, it

will be returned to adress Y ?

i tried to work by approach described in that article :
http://www.codeproject.com/useritem...ddress_list.asp


it looks streigforard, but author is using easymail object
with System.Web.Mail i did not find any way to set OptionFlags to
prevent auto-creation of reverse-path


so , my code looks exactly like described in the article, but without
OptionFlag
and when i send mail to unavailable address, i got bounce to email
specified in "FROM" header


my code example if it can help :
<pre>
MailMessage oMsg = new MailMessage();
// bounced emails goes to email specified in oMsg.From
// sender name displayed for recipient is
oMsg.Headers["From"]oMsg.Headers.Add("Reply-To", oMsgDetails.ReplyTo);
oMsg.Headers.Add("From", oMsgDetails.Sender); oMsg.From =
txtBounceTo.Text ; //reverse-path
oMsg.Subject = oMsgDetails.Subject;
oMsg.BodyFormat = MailFormat.Html;
oMsg.Priority = MailPriority.Normal;
oMsg.To = emailAddress;
oMsg.Body = oMsgDetails.Content;
SmtpMail.SmtpServer = mailServer;
SmtpMail.Send(oMsg);
</pre>


appreciate any help
Thanks

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com