sending mails bounced to address different from sender address

Discussion in 'ASP .Net' started by SharpSmith@gmail.com, Apr 11, 2006.

  1. Guest

    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/clean_your_address_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 11, 2006
    #1
    1. Advertising

  2. Jeff Dillon Guest

    One way would be to set up a rule in the inbox for X to forward any messages
    that have a specific text in the subject line to Y

    No need to cross-post so much.

    Jeff
    <> wrote in message
    news:...
    > 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/clean_your_address_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
    >
     
    Jeff Dillon, Apr 11, 2006
    #2
    1. Advertising

  3. I'm not sure if you can do this systematically because you are really at the
    mercy of the receiver. If an email goes into a mail server where it will
    bounce automatically, the email program on that server can be configured to
    use either the From address or the Reply-To address. Thus, you have no
    control over and can only hope that they'll use your Reply-To address.
    --
    Christopher A. Reed
    "The oxen are slow, but the earth is patient."

    <> wrote in message
    news:...
    > 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/clean_your_address_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
    >
     
    Christopher Reed, Apr 15, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Showjumper
    Replies:
    2
    Views:
    1,818
    Showjumper
    Aug 2, 2003
  2. Dylan Parry
    Replies:
    2
    Views:
    562
  3. Replies:
    0
    Views:
    404
  4. Replies:
    0
    Views:
    364
  5. Frank

    Handling Bounced E-Mails

    Frank, Aug 14, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    369
    jamesd
    Aug 14, 2006
Loading...

Share This Page