MailMessage Headers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simran

    #1

    MailMessage Headers

    I need to set up an automated email system , which means users should
    not be able to respond back to the emails but at the same time, we
    need to track bounced emails. This is important as our customers are
    paying for this service, so we need to track the bounced email Id's.

    This is the code which I have tried:-

    MailMessage msgRequest = new MailMessage();
    msgRequest.Body Format = MailFormat.Text ;
    msgRequest.Subj ect = "Do Not reply to this email";
    msgRequest.To = "Customer1@abc. com";
    msgRequest.From = "automated@comp any.com";
    msgRequest.Body = "Message Body";
    msgRequest.Head ers.Add("Return-Path", "validemailId@c ompany.com");
    //msgRequest.Head ers.Add("Errors-To", "validemailId@c ompany.com");
    SmtpMail.SmtpSe rver = "SMTPServerName ";
    SmtpMail.Send(m sgRequest);

    I have tried both "Return-Path" and "Errors-to". But both of them
    falied. The functionality that users cannot reply us back works fine
    with this code but this code fails in tracking bounced emails. So for
    invalid email id in "To", have no action reported to "return-path" or
    "errors-to" valid Email Id.

    I have also tried doing this:-

    MailMessage msgRequest = new MailMessage();
    msgRequest.Body Format = MailFormat.Text ;
    msgRequest.Subj ect = "Do Not reply to this email";
    msgRequest.To = "Customer1@abc. com";
    msgRequest.From = "validemailId@c ompany.com";
    msgRequest.Body = "Message Body";
    msgRequest.Head ers.Add("From", "automated@comp any.com");
    SmtpMail.SmtpSe rver = "SMTPServerName ";
    SmtpMail.Send(m sgRequest);

    Using this code, user only sees automated@compa ny.com and never sees
    validemailId@co mpany.com so they cannot reply us back. But again this
    code fails for tracking bounced emails. It doesnt send me bounced
    emails at validemailId@co mpany.com.

    Can somebody suggest me what is going wrong here?

    Quick response will be really appreciated and Thanks in Advance for
    any help.
  • Hermit Dave

    #2
    Re: MailMessage Headers

    Sounds like you working on a system to spam some poor souls... :)

    a. you should own the smtp server unless you are actually spamming and
    relying on hacked machines to serve as relays.

    b. if a == true then just look in the logs of the smtp servers they usually
    dump the bad emails in a folder.

    c. the headers that you have added i would imagine depend upon the
    underlying smtp server to actually read and return you the bounced email

    HTH

    --

    Regards,

    Hermit Dave
    (http://hdave.blogspot.com)
    "Simran" <simrang333@yah oo.com> wrote in message
    news:75599587.0 408310800.4e477 6b6@posting.goo gle.com...[color=blue]
    >I need to set up an automated email system , which means users should
    > not be able to respond back to the emails but at the same time, we
    > need to track bounced emails. This is important as our customers are
    > paying for this service, so we need to track the bounced email Id's.
    >
    > This is the code which I have tried:-
    >
    > MailMessage msgRequest = new MailMessage();
    > msgRequest.Body Format = MailFormat.Text ;
    > msgRequest.Subj ect = "Do Not reply to this email";
    > msgRequest.To = "Customer1@abc. com";
    > msgRequest.From = "automated@comp any.com";
    > msgRequest.Body = "Message Body";
    > msgRequest.Head ers.Add("Return-Path", "validemailId@c ompany.com");
    > //msgRequest.Head ers.Add("Errors-To", "validemailId@c ompany.com");
    > SmtpMail.SmtpSe rver = "SMTPServerName ";
    > SmtpMail.Send(m sgRequest);
    >
    > I have tried both "Return-Path" and "Errors-to". But both of them
    > falied. The functionality that users cannot reply us back works fine
    > with this code but this code fails in tracking bounced emails. So for
    > invalid email id in "To", have no action reported to "return-path" or
    > "errors-to" valid Email Id.
    >
    > I have also tried doing this:-
    >
    > MailMessage msgRequest = new MailMessage();
    > msgRequest.Body Format = MailFormat.Text ;
    > msgRequest.Subj ect = "Do Not reply to this email";
    > msgRequest.To = "Customer1@abc. com";
    > msgRequest.From = "validemailId@c ompany.com";
    > msgRequest.Body = "Message Body";
    > msgRequest.Head ers.Add("From", "automated@comp any.com");
    > SmtpMail.SmtpSe rver = "SMTPServerName ";
    > SmtpMail.Send(m sgRequest);
    >
    > Using this code, user only sees automated@compa ny.com and never sees
    > validemailId@co mpany.com so they cannot reply us back. But again this
    > code fails for tracking bounced emails. It doesnt send me bounced
    > emails at validemailId@co mpany.com.
    >
    > Can somebody suggest me what is going wrong here?
    >
    > Quick response will be really appreciated and Thanks in Advance for
    > any help.[/color]


    Comment

    • Hermit Dave

      #3
      Re: MailMessage Headers

      didnt like the answer or what i bang on target (regarding spamming poor
      souls)?

      --

      Regards,

      Hermit Dave
      (http://hdave.blogspot.com)
      "Hermit Dave" <hermitd.REMOVE @CAPS.AND.DOTS. hotmail.com> wrote in message
      news:uAcYjS3jEH A.548@TK2MSFTNG P11.phx.gbl...[color=blue]
      > Sounds like you working on a system to spam some poor souls... :)
      >
      > a. you should own the smtp server unless you are actually spamming and
      > relying on hacked machines to serve as relays.
      >
      > b. if a == true then just look in the logs of the smtp servers they[/color]
      usually[color=blue]
      > dump the bad emails in a folder.
      >
      > c. the headers that you have added i would imagine depend upon the
      > underlying smtp server to actually read and return you the bounced email
      >
      > HTH
      >
      > --
      >
      > Regards,
      >
      > Hermit Dave
      > (http://hdave.blogspot.com)
      > "Simran" <simrang333@yah oo.com> wrote in message
      > news:75599587.0 408310800.4e477 6b6@posting.goo gle.com...[color=green]
      > >I need to set up an automated email system , which means users should
      > > not be able to respond back to the emails but at the same time, we
      > > need to track bounced emails. This is important as our customers are
      > > paying for this service, so we need to track the bounced email Id's.
      > >
      > > This is the code which I have tried:-
      > >
      > > MailMessage msgRequest = new MailMessage();
      > > msgRequest.Body Format = MailFormat.Text ;
      > > msgRequest.Subj ect = "Do Not reply to this email";
      > > msgRequest.To = "Customer1@abc. com";
      > > msgRequest.From = "automated@comp any.com";
      > > msgRequest.Body = "Message Body";
      > > msgRequest.Head ers.Add("Return-Path", "validemailId@c ompany.com");
      > > //msgRequest.Head ers.Add("Errors-To", "validemailId@c ompany.com");
      > > SmtpMail.SmtpSe rver = "SMTPServerName ";
      > > SmtpMail.Send(m sgRequest);
      > >
      > > I have tried both "Return-Path" and "Errors-to". But both of them
      > > falied. The functionality that users cannot reply us back works fine
      > > with this code but this code fails in tracking bounced emails. So for
      > > invalid email id in "To", have no action reported to "return-path" or
      > > "errors-to" valid Email Id.
      > >
      > > I have also tried doing this:-
      > >
      > > MailMessage msgRequest = new MailMessage();
      > > msgRequest.Body Format = MailFormat.Text ;
      > > msgRequest.Subj ect = "Do Not reply to this email";
      > > msgRequest.To = "Customer1@abc. com";
      > > msgRequest.From = "validemailId@c ompany.com";
      > > msgRequest.Body = "Message Body";
      > > msgRequest.Head ers.Add("From", "automated@comp any.com");
      > > SmtpMail.SmtpSe rver = "SMTPServerName ";
      > > SmtpMail.Send(m sgRequest);
      > >
      > > Using this code, user only sees automated@compa ny.com and never sees
      > > validemailId@co mpany.com so they cannot reply us back. But again this
      > > code fails for tracking bounced emails. It doesnt send me bounced
      > > emails at validemailId@co mpany.com.
      > >
      > > Can somebody suggest me what is going wrong here?
      > >
      > > Quick response will be really appreciated and Thanks in Advance for
      > > any help.[/color]
      >
      >[/color]


      Comment

      • Simran

        #4
        Re: MailMessage Headers

        Thanks a lot for replying but I couldnt completely understand how to
        solve my problem technically. Can you elaborate more on it. I am not
        trying to spam any mails. My code deals with sending automated emails
        to the customers with the information they need but they should not be
        able to reply back to us. This is simple to achieve but the problem
        arises when we want to track those emails which were bounced back
        because of invalid customer id's so that we can contact those
        customers for providing correct email ids.

        Thanks in Advance!!!.

        "Hermit Dave" <hermitd.REMOVE @CAPS.AND.DOTS. hotmail.com> wrote in message news:<uAcYjS3jE HA.548@TK2MSFTN GP11.phx.gbl>.. .[color=blue]
        > Sounds like you working on a system to spam some poor souls... :)
        >
        > a. you should own the smtp server unless you are actually spamming and
        > relying on hacked machines to serve as relays.
        >
        > b. if a == true then just look in the logs of the smtp servers they usually
        > dump the bad emails in a folder.
        >
        > c. the headers that you have added i would imagine depend upon the
        > underlying smtp server to actually read and return you the bounced email
        >
        > HTH
        >
        > --
        >
        > Regards,
        >
        > Hermit Dave
        > (http://hdave.blogspot.com)
        > "Simran" <simrang333@yah oo.com> wrote in message
        > news:75599587.0 408310800.4e477 6b6@posting.goo gle.com...[color=green]
        > >I need to set up an automated email system , which means users should
        > > not be able to respond back to the emails but at the same time, we
        > > need to track bounced emails. This is important as our customers are
        > > paying for this service, so we need to track the bounced email Id's.
        > >
        > > This is the code which I have tried:-
        > >
        > > MailMessage msgRequest = new MailMessage();
        > > msgRequest.Body Format = MailFormat.Text ;
        > > msgRequest.Subj ect = "Do Not reply to this email";
        > > msgRequest.To = "Customer1@abc. com";
        > > msgRequest.From = "automated@comp any.com";
        > > msgRequest.Body = "Message Body";
        > > msgRequest.Head ers.Add("Return-Path", "validemailId@c ompany.com");
        > > //msgRequest.Head ers.Add("Errors-To", "validemailId@c ompany.com");
        > > SmtpMail.SmtpSe rver = "SMTPServerName ";
        > > SmtpMail.Send(m sgRequest);
        > >
        > > I have tried both "Return-Path" and "Errors-to". But both of them
        > > falied. The functionality that users cannot reply us back works fine
        > > with this code but this code fails in tracking bounced emails. So for
        > > invalid email id in "To", have no action reported to "return-path" or
        > > "errors-to" valid Email Id.
        > >
        > > I have also tried doing this:-
        > >
        > > MailMessage msgRequest = new MailMessage();
        > > msgRequest.Body Format = MailFormat.Text ;
        > > msgRequest.Subj ect = "Do Not reply to this email";
        > > msgRequest.To = "Customer1@abc. com";
        > > msgRequest.From = "validemailId@c ompany.com";
        > > msgRequest.Body = "Message Body";
        > > msgRequest.Head ers.Add("From", "automated@comp any.com");
        > > SmtpMail.SmtpSe rver = "SMTPServerName ";
        > > SmtpMail.Send(m sgRequest);
        > >
        > > Using this code, user only sees automated@compa ny.com and never sees
        > > validemailId@co mpany.com so they cannot reply us back. But again this
        > > code fails for tracking bounced emails. It doesnt send me bounced
        > > emails at validemailId@co mpany.com.
        > >
        > > Can somebody suggest me what is going wrong here?
        > >
        > > Quick response will be really appreciated and Thanks in Advance for
        > > any help.[/color][/color]

        Comment

        • Eric Gibson

          #5
          Re: MailMessage Headers

          Hermit Dave wrote:[color=blue]
          > Sounds like you working on a system to spam some poor souls... :)
          >[/color]

          That's absolutely ridiculous. My support and signup system modifies the envelope in
          a similar way, and there are a myriad of reason's to modify the envelope for
          catching bounces in a way that reflect your business rules that have nothing to do
          with spamming...

          Anyway...

          To answer your question, Simran. What mail server are you using?

          Simply adding "Return-Path" on your own, as a header, most of the time won't do
          because the server overwrites it with it's own envelope based on how you are sending
          the message (it almost always will overwrite it with your "From" address, is that
          what is happening to you?). "Return-Path" isn't really a user editable "header" in
          most circumstances, it's a server "envelope". You usually have to configure the
          server to either a) Accept the Return-Path header from you, and write the
          Return-Path accordingly or b) Configure the server to always write the Return-Path
          envelope to the value you want for that user.

          "Errors-To" works a lot of the time, but it's completely up to the mail server on
          the other end whether it will accomodate you or not. It's good to add it though in
          addition to whatever fix you come up with from modifying the return-path on the
          server, because some servers ignore the Return-Path envelope for sending bounces.
          :-0

          Eric



          Comment

          • Simran

            #6
            Re: MailMessage Headers

            Thanks Eric, This really helps.

            Comment

            Working...