473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

send mass mail and have bounces to go back to different address

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/useritems...dress_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

Apr 12 '06 #1
2 3209
The usual way to do this would be to set the Reply To address

"Sh********@gmail.com" wrote:
The usual way to do this would be by using Reply To, but the MailMessage
object doesn't seem to have a reply to property. It does however have a
headers collection so is supect you could set it in there.

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/useritems...dress_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

Apr 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Giobibo | last post by:
I use the following code to send e-mails with PHP: if(@mail(....)) { //Send OK } else { //Send Bad } But how can I verify that a message was really sent (in case of "Sent
3
by: somaboy mx | last post by:
I'm putting together a mass mailing application for sending out newsletters from a site admin area (no spam). I'm wondering how I can automate the removal of bounced addresses in this...
4
by: CK | last post by:
Hi all, I know this question is stupid. But i need some advice for this. I am trying to develop a website, which will allow the user send to order form to the admin email. I am planning to use the...
6
by: Mike the Canadian | last post by:
I am having a very strange problem sending email with php. I have two domains. I can send an email to one domain using php but not the other. If I put both email addresses in the mail command only...
11
by: Jonah Olsson | last post by:
Hi guys, I'm trying to figure out how to use MailMessage to send mails with a different return path than the sender if the delivery fails. Here's the case: Sender: Joe's Pizza Sender email:...
2
by: Ron | last post by:
hi guys, I am trying to send email using smtpMail. I can send emails inside the organization, but out of the organization I get an error "The server rejected one or more recipient addresses. The...
2
by: Yeah | last post by:
I have a simple fill-out form with three fields, in this order: Name, E-mail, and Comment. But when I receive the E-mail containing the form data, the fields are listed backwards (Comment, E-mail,...
39
by: Viken Karaguesian | last post by:
Hello all, <SIGH> I'm soooooo sick and tired of getting spam e-mails. I'm sure that part of the reson for this is that my e-mail address is publicly available on my website, ready to be picked...
2
by: upendrajpr | last post by:
Dear friends I am sending mail from my site but it gives me some error "Warning: mail() : "sendmail_from" not set in php.ini or custom "From:" header missing in C:\P............." my...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.