473,805 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 = "Cu*******@abc. com";
msgRequest.From = "au*******@comp any.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("Return-Path", "va**********@c ompany.com");
//msgRequest.Head ers.Add("Errors-To", "va**********@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 = "Cu*******@abc. com";
msgRequest.From = "va**********@c ompany.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("From", "au*******@comp any.com");
SmtpMail.SmtpSe rver = "SMTPServerName ";
SmtpMail.Send(m sgRequest);

Using this code, user only sees au*******@compa ny.com and never sees
va**********@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 va**********@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.
Nov 16 '05 #1
5 8461
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********@yah oo.com> wrote in message
news:75******** *************** ***@posting.goo gle.com...
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 = "Cu*******@abc. com";
msgRequest.From = "au*******@comp any.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("Return-Path", "va**********@c ompany.com");
//msgRequest.Head ers.Add("Errors-To", "va**********@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 = "Cu*******@abc. com";
msgRequest.From = "va**********@c ompany.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("From", "au*******@comp any.com");
SmtpMail.SmtpSe rver = "SMTPServerName ";
SmtpMail.Send(m sgRequest);

Using this code, user only sees au*******@compa ny.com and never sees
va**********@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 va**********@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.

Nov 16 '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******** *****@TK2MSFTNG P11.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********@yah oo.com> wrote in message
news:75******** *************** ***@posting.goo gle.com...
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 = "Cu*******@abc. com";
msgRequest.From = "au*******@comp any.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("Return-Path", "va**********@c ompany.com");
//msgRequest.Head ers.Add("Errors-To", "va**********@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 = "Cu*******@abc. com";
msgRequest.From = "va**********@c ompany.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("From", "au*******@comp any.com");
SmtpMail.SmtpSe rver = "SMTPServerName ";
SmtpMail.Send(m sgRequest);

Using this code, user only sees au*******@compa ny.com and never sees
va**********@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 va**********@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.


Nov 16 '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******* ******@TK2MSFTN GP11.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********@yah oo.com> wrote in message
news:75******** *************** ***@posting.goo gle.com...
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 = "Cu*******@abc. com";
msgRequest.From = "au*******@comp any.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("Return-Path", "va**********@c ompany.com");
//msgRequest.Head ers.Add("Errors-To", "va**********@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 = "Cu*******@abc. com";
msgRequest.From = "va**********@c ompany.com";
msgRequest.Body = "Message Body";
msgRequest.Head ers.Add("From", "au*******@comp any.com");
SmtpMail.SmtpSe rver = "SMTPServerName ";
SmtpMail.Send(m sgRequest);

Using this code, user only sees au*******@compa ny.com and never sees
va**********@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 va**********@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.

Nov 16 '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 16 '05 #5
Thanks Eric, This really helps.
Nov 16 '05 #6

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

Similar topics

5
4574
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 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...
2
11800
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 should have the To: field appear as "Joe Bloggs" rather than the plain e-mail address. Any ideas?
1
2922
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 ReadReceipt property for CDO 1.2.1, but I have not been able to find a ASP.NET or MailMessage article that specifically deals with this issue. Additionally, it appears that utilizing an Outlook object this is also possible, but this system will...
1
3501
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? I was thinking adding custom properties to System.Net.Mail.MailMessage.Headers. but it's a READONLY property. System.Net.Mail.MailMessage has few header fields as properties (eg: FROM, TO, CC) and these are not sufficient.
5
2136
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(); emailMessage.To = <address> emailMessage.Subject = "my subject"; emailMessage.Headers.Add("Content-Type","text/calendar;method=\"REQUEST\""); emailMessage.Body=@"BEGIN:VCALENDAR PRODID:-//ACME/DesktopCalendar//EN METHOD:REQUEST
1
4678
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 reference a CSS file in the header of my newsletter message ?" Here is where I am .... (1) I found a way to reference a web page in the body of the message (ref: http://www.systemwebmail.com/faq/3.2.aspx) Dim mail As New MailMessage()
8
5195
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 an email received by their system. That's not the odd part. The oddity is they want to have a single X-Header containing multiple keys and values that are delimited by a carriage return, line feed and tab. The vendor claims other customers...
0
1907
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 consider following code: MailMessage mail = new MailMessage(); mail.Headers.Add("X-ECE_SEND", "1.01"); string str1 = mail.Headers.Keys; //MailMessage.Headers is of NameValueCollection
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10609
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10360
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10105
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5542
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.