473,383 Members | 1,862 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,383 software developers and data experts.

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.BodyFormat = MailFormat.Text;
msgRequest.Subject = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc.com";
msgRequest.From = "au*******@company.com";
msgRequest.Body = "Message Body";
msgRequest.Headers.Add("Return-Path", "va**********@company.com");
//msgRequest.Headers.Add("Errors-To", "va**********@company.com");
SmtpMail.SmtpServer = "SMTPServerName";
SmtpMail.Send(msgRequest);

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.BodyFormat = MailFormat.Text;
msgRequest.Subject = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc.com";
msgRequest.From = "va**********@company.com";
msgRequest.Body = "Message Body";
msgRequest.Headers.Add("From", "au*******@company.com");
SmtpMail.SmtpServer = "SMTPServerName";
SmtpMail.Send(msgRequest);

Using this code, user only sees au*******@company.com and never sees
va**********@company.com so they cannot reply us back. But again this
code fails for tracking bounced emails. It doesnt send me bounced
emails at va**********@company.com.

Can somebody suggest me what is going wrong here?

Quick response will be really appreciated and Thanks in Advance for
any help.
Nov 18 '05 #1
5 1491
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" <si********@yahoo.com> wrote in message
news:75**************************@posting.google.c om...
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.BodyFormat = MailFormat.Text;
msgRequest.Subject = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc.com";
msgRequest.From = "au*******@company.com";
msgRequest.Body = "Message Body";
msgRequest.Headers.Add("Return-Path", "va**********@company.com");
//msgRequest.Headers.Add("Errors-To", "va**********@company.com");
SmtpMail.SmtpServer = "SMTPServerName";
SmtpMail.Send(msgRequest);

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.BodyFormat = MailFormat.Text;
msgRequest.Subject = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc.com";
msgRequest.From = "va**********@company.com";
msgRequest.Body = "Message Body";
msgRequest.Headers.Add("From", "au*******@company.com");
SmtpMail.SmtpServer = "SMTPServerName";
SmtpMail.Send(msgRequest);

Using this code, user only sees au*******@company.com and never sees
va**********@company.com so they cannot reply us back. But again this
code fails for tracking bounced emails. It doesnt send me bounced
emails at va**********@company.com.

Can somebody suggest me what is going wrong here?

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

Nov 18 '05 #2
didnt like the answer or what i bang on target (regarding spamming poor
souls)?

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:uA*************@TK2MSFTNGP11.phx.gbl...
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" <si********@yahoo.com> wrote in message
news:75**************************@posting.google.c om...
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.BodyFormat = MailFormat.Text;
msgRequest.Subject = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc.com";
msgRequest.From = "au*******@company.com";
msgRequest.Body = "Message Body";
msgRequest.Headers.Add("Return-Path", "va**********@company.com");
//msgRequest.Headers.Add("Errors-To", "va**********@company.com");
SmtpMail.SmtpServer = "SMTPServerName";
SmtpMail.Send(msgRequest);

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.BodyFormat = MailFormat.Text;
msgRequest.Subject = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc.com";
msgRequest.From = "va**********@company.com";
msgRequest.Body = "Message Body";
msgRequest.Headers.Add("From", "au*******@company.com");
SmtpMail.SmtpServer = "SMTPServerName";
SmtpMail.Send(msgRequest);

Using this code, user only sees au*******@company.com and never sees
va**********@company.com so they cannot reply us back. But again this
code fails for tracking bounced emails. It doesnt send me bounced
emails at va**********@company.com.

Can somebody suggest me what is going wrong here?

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


Nov 18 '05 #3
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" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message news:<uA*************@TK2MSFTNGP11.phx.gbl>...
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" <si********@yahoo.com> wrote in message
news:75**************************@posting.google.c om...
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.BodyFormat = MailFormat.Text;
msgRequest.Subject = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc.com";
msgRequest.From = "au*******@company.com";
msgRequest.Body = "Message Body";
msgRequest.Headers.Add("Return-Path", "va**********@company.com");
//msgRequest.Headers.Add("Errors-To", "va**********@company.com");
SmtpMail.SmtpServer = "SMTPServerName";
SmtpMail.Send(msgRequest);

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.BodyFormat = MailFormat.Text;
msgRequest.Subject = "Do Not reply to this email";
msgRequest.To = "Cu*******@abc.com";
msgRequest.From = "va**********@company.com";
msgRequest.Body = "Message Body";
msgRequest.Headers.Add("From", "au*******@company.com");
SmtpMail.SmtpServer = "SMTPServerName";
SmtpMail.Send(msgRequest);

Using this code, user only sees au*******@company.com and never sees
va**********@company.com so they cannot reply us back. But again this
code fails for tracking bounced emails. It doesnt send me bounced
emails at va**********@company.com.

Can somebody suggest me what is going wrong here?

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

Nov 18 '05 #4
Hermit Dave wrote:
Sounds like you working on a system to spam some poor souls... :)


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

Nov 18 '05 #5
Thanks Eric, This really helps.
Nov 18 '05 #6

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

Similar topics

5
by: Simran | last post by:
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...
2
by: Richard Bogle | last post by:
Hi, MailMessage.From allows me to set the email address that the message comes from but not the "covering address" (sorry, no idea what the correct terminology might be). The email message...
1
by: Wade Wegner | last post by:
Hello, Using the MailMessage class (or any other ASP.NET SMTP classes), I would like to programmatically request a read receipt. Is this possible? I have found an article that talked about a...
1
by: asnowfall | last post by:
I am creating MailMessage out of already existing email message. My existing message has few custom properties. I wan to add them to System.Net.Mail.MailMessage How to add custom properties? ...
5
by: Vlad | last post by:
We are trying to set MailMessage Content-Type to be text/calendar The following code has been used: string subject = "Calendar test 3"; MailMessage emailMessage = new MailMessage();...
1
by: Michel Couche | last post by:
Hello, I am starting the development of a newsletter The use of the class MailMessage of System.Net.Mail is quite straightforward for usual contact forms but my question here is "How can I...
8
by: travispennington | last post by:
To anyone that can assist me: I deeply appreciate your help!! I am developing an application with an outside vendor. The vendor has a very odd requirement. They need custom X-Headers added to...
0
by: Afshar | last post by:
Whenever I add a key to Headers it turns to a lower cased one while Headers is of type NameValueCollection and NameValueCollection itslef does not apply any lower or upper case change. Please...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.