I'm having issues sending an email to an "@page.nextel.com" email
address. I can send to any other email address fine, but when I try
the page.nextel.com it gives me this error:
Final-Recipient: XX*****@page.nextel.com
Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF
characters.
Action: failed
Status: 5.0.0
I think it has something to do with the headers that are being sent.
All I have in the subject and body is the word "test." Using this
same SMTP relay, I can get a PHP script to send an email if I strip
out all the headers. Whenever I send via MailMessage/SmtpClient it
fails. I've tried using the MailMessage.headers.clear(), but no
success.
Here is my code:
MailMessage mess = new MailMessage(txtFrom.Text,
txtTo.Text);
mess.Subject = "Test Message";
mess.Body = "Test Message";
mess.Headers.Add("From", txtFrom.Text);
mess.Headers.Add("To", txtTo.Text);
SmtpClient client = new SmtpClient(smtpServer, 25);
client.Send(mess);
mess.Dispose();
Thanks
Marty 8 3753
Try specifying an Encoding in your Message. I had problems with SMTP in the
past and it was solved (in part) by setting the Encoding.
"Marty" wrote:
I'm having issues sending an email to an "@page.nextel.com" email
address. I can send to any other email address fine, but when I try
the page.nextel.com it gives me this error:
Final-Recipient: XX*****@page.nextel.com
Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF
characters.
Action: failed
Status: 5.0.0
I think it has something to do with the headers that are being sent.
All I have in the subject and body is the word "test." Using this
same SMTP relay, I can get a PHP script to send an email if I strip
out all the headers. Whenever I send via MailMessage/SmtpClient it
fails. I've tried using the MailMessage.headers.clear(), but no
success.
Here is my code:
MailMessage mess = new MailMessage(txtFrom.Text,
txtTo.Text);
mess.Subject = "Test Message";
mess.Body = "Test Message";
mess.Headers.Add("From", txtFrom.Text);
mess.Headers.Add("To", txtTo.Text);
SmtpClient client = new SmtpClient(smtpServer, 25);
client.Send(mess);
mess.Dispose();
Thanks
Marty
On Jun 10, 2:26 pm, jp2msft <jp2m...@discussions.microsoft.comwrote:
Try specifying an Encoding in your Message. I had problems with SMTP in the
past and it was solved (in part) by setting the Encoding.
"Marty" wrote:
I'm having issues sending an email to an "@page.nextel.com" email
address. I can send to any other email address fine, but when I try
the page.nextel.com it gives me this error:
Final-Recipient: XXXX...@page.nextel.com
Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF
characters.
Action: failed
Status: 5.0.0
I think it has something to do with the headers that are being sent.
All I have in the subject and body is the word "test." Using this
same SMTP relay, I can get a PHP script to send an email if I strip
out all the headers. Whenever I send via MailMessage/SmtpClient it
fails. I've tried using the MailMessage.headers.clear(), but no
success.
Here is my code:
MailMessage mess = new MailMessage(txtFrom.Text,
txtTo.Text);
mess.Subject = "Test Message";
mess.Body = "Test Message";
mess.Headers.Add("From", txtFrom.Text);
mess.Headers.Add("To", txtTo.Text);
SmtpClient client = new SmtpClient(smtpServer, 25);
client.Send(mess);
mess.Dispose();
Thanks
Marty
What encoding should I try? UTF8, Unicode, or UTF3....
Marty <ma***********@gmail.comwrote in news:54762a45-d5fc-4eaf-bb44- 5e**********@e53g2000hsa.googlegroups.com:
Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF
characters.
That suggests that there's a bug in SmtpClient.Send. The error message is
probably from the Postfix mail server and is saying that there's either a
LF or CR by itself on the end of a line. SMTP requires that lines end with
a CR followed by a LF.
Where does the SmtpClient class come from?
See section 2.3.7 (Lines) here: http://www.faqs.org/rfcs/rfc2821
Start with Unicode. I think more things are supposed to be going to that.
"Marty" wrote:
On Jun 10, 2:26 pm, jp2msft <jp2m...@discussions.microsoft.comwrote:
Try specifying an Encoding in your Message. I had problems with SMTP in the
past and it was solved (in part) by setting the Encoding.
"Marty" wrote:
I'm having issues sending an email to an "@page.nextel.com" email
address. I can send to any other email address fine, but when I try
the page.nextel.com it gives me this error:
Final-Recipient: XXXX...@page.nextel.com
Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF
characters.
Action: failed
Status: 5.0.0
I think it has something to do with the headers that are being sent.
All I have in the subject and body is the word "test." Using this
same SMTP relay, I can get a PHP script to send an email if I strip
out all the headers. Whenever I send via MailMessage/SmtpClient it
fails. I've tried using the MailMessage.headers.clear(), but no
success.
Here is my code:
MailMessage mess = new MailMessage(txtFrom.Text,
txtTo.Text);
mess.Subject = "Test Message";
mess.Body = "Test Message";
mess.Headers.Add("From", txtFrom.Text);
mess.Headers.Add("To", txtTo.Text);
SmtpClient client = new SmtpClient(smtpServer, 25);
client.Send(mess);
mess.Dispose();
Thanks
Marty
What encoding should I try? UTF8, Unicode, or UTF3....
On Jun 10, 2:44 pm, Marty <marty.wass...@gmail.comwrote:
On Jun 10, 2:26 pm, jp2msft <jp2m...@discussions.microsoft.comwrote:
Try specifying an Encoding in your Message. I had problems with SMTP in the
past and it was solved (in part) by setting the Encoding.
"Marty" wrote:
I'm having issues sending an email to an "@page.nextel.com" email
address. I can send to any other email address fine, but when I try
the page.nextel.com it gives me this error:
Final-Recipient: XXXX...@page.nextel.com
Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF
characters.
Action: failed
Status: 5.0.0
I think it has something to do with the headers that are being sent.
All I have in the subject and body is the word "test." Using this
same SMTP relay, I can get a PHP script to send an email if I strip
out all the headers. Whenever I send via MailMessage/SmtpClient it
fails. I've tried using the MailMessage.headers.clear(), but no
success.
Here is my code:
MailMessage mess = new MailMessage(txtFrom.Text,
txtTo.Text);
mess.Subject = "Test Message";
mess.Body = "Test Message";
mess.Headers.Add("From", txtFrom.Text);
mess.Headers.Add("To", txtTo.Text);
SmtpClient client = new SmtpClient(smtpServer, 25);
client.Send(mess);
mess.Dispose();
Thanks
Marty
What encoding should I try? UTF8, Unicode, or UTF3....
I tried all encoding types with no luck. Here is the code I used
before the SmtpClient.Send().
mess.BodyEncoding = System.Text.Encoding.Unicode;
mess.SubjectEncoding = System.Text.Encoding.Unicode;
Kenneth Porter <sh*************@sewingwitch.comwrote in
news:Xn**************************@207.46.248.16:
That suggests that there's a bug in SmtpClient.Send. The error message
is probably from the Postfix mail server and is saying that there's
either a LF or CR by itself on the end of a line. SMTP requires that
lines end with a CR followed by a LF.
Looks like this isn't the only bug: http://www.themssforum.com/Framework...uthentication/
Get a copy of Wireshark and see what characters are really being exchanged. http://www.wireshark.org/
You aren't having conflicts between the MailMessage types, are you? I believe
the two types are System.Net.Mail and ...System.Web.Mail? (not sure about the
second)
Here is what my code looks like:
// ---------------------
bool ok = true;
MailAddress toMe = new MailAddress("fa*********@joeswelding.biz");
// txtEmail is a TextBox on the form:
MailAddress from = new MailAddress(txtEmail.Text); // from the form
System.Net.Mail.MailMessage Email =
new System.Net.Mail.MailMessage(from, toMe);
// Your host will probably be different. This is what I use on GoDaddy
SmtpClient server = new SmtpClient("relay-hosting.secureserver.net");
// txtMessage is a TextBox on the form:
string strHtmlBody = "<html><body>" + txtMessage.Text + "</body></html>";
Email.Subject = "Joe's Welding - Contact";
Email.Body = strHtmlBody;
Email.IsBodyHtml = true;
try {
server.Send(Email);
} catch (Exception err) {
Response.Write("<b>Unable to send: " + err.Message + "</b><br/>");
ok = false;
}
// ----------------------
Is this very different from what you are running?
"Marty" wrote:
On Jun 10, 2:44 pm, Marty <marty.wass...@gmail.comwrote:
On Jun 10, 2:26 pm, jp2msft <jp2m...@discussions.microsoft.comwrote:
Try specifying an Encoding in your Message. I had problems with SMTP in the
past and it was solved (in part) by setting the Encoding.
"Marty" wrote:
I'm having issues sending an email to an "@page.nextel.com" email
address. I can send to any other email address fine, but when I try
the page.nextel.com it gives me this error:
Final-Recipient: XXXX...@page.nextel.com
Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF
characters.
Action: failed
Status: 5.0.0
I think it has something to do with the headers that are being sent.
All I have in the subject and body is the word "test." Using this
same SMTP relay, I can get a PHP script to send an email if I strip
out all the headers. Whenever I send via MailMessage/SmtpClient it
fails. I've tried using the MailMessage.headers.clear(), but no
success.
Here is my code:
MailMessage mess = new MailMessage(txtFrom.Text,
txtTo.Text);
mess.Subject = "Test Message";
mess.Body = "Test Message";
mess.Headers.Add("From", txtFrom.Text);
mess.Headers.Add("To", txtTo.Text);
SmtpClient client = new SmtpClient(smtpServer, 25);
client.Send(mess);
mess.Dispose();
Thanks
Marty
What encoding should I try? UTF8, Unicode, or UTF3....
I tried all encoding types with no luck. Here is the code I used
before the SmtpClient.Send().
mess.BodyEncoding = System.Text.Encoding.Unicode;
mess.SubjectEncoding = System.Text.Encoding.Unicode;
Please look following articles for the sending email using SMTP. http://www.a2zdotnet.com/View.aspx?id=38 http://www.a2zdotnet.com/View.aspx?id=50
--
regards,
Pankaj http://www.A2ZDotNet.com
"Marty" wrote:
I'm having issues sending an email to an "@page.nextel.com" email
address. I can send to any other email address fine, but when I try
the page.nextel.com it gives me this error:
Final-Recipient: XX*****@page.nextel.com
Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF
characters.
Action: failed
Status: 5.0.0
I think it has something to do with the headers that are being sent.
All I have in the subject and body is the word "test." Using this
same SMTP relay, I can get a PHP script to send an email if I strip
out all the headers. Whenever I send via MailMessage/SmtpClient it
fails. I've tried using the MailMessage.headers.clear(), but no
success.
Here is my code:
MailMessage mess = new MailMessage(txtFrom.Text,
txtTo.Text);
mess.Subject = "Test Message";
mess.Body = "Test Message";
mess.Headers.Add("From", txtFrom.Text);
mess.Headers.Add("To", txtTo.Text);
SmtpClient client = new SmtpClient(smtpServer, 25);
client.Send(mess);
mess.Dispose();
Thanks
Marty This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: JD |
last post by:
Is it possible using the smtp class in asp.net to send emails and
authenticate to the mail server that is sending the emails out.
Currently I have a web application that works fine on my machine,...
|
by: 00_DotNetWarrior |
last post by:
I followed this article to do authenticated SMTP, it works fine with port
25. (using .NET framework 1.1)
http://support.microsoft.com/default.aspx?scid=kb;en-us;555287
However, if I change the...
|
by: antonyliu2002 |
last post by:
I've set up the virtual smtp server on my IIS 5.1 like so:
1. Assign IP address to "All Unassigned", and listen to port 25.
2. Access Connection granted to "127.0.0.1".
3. Relay only allow...
|
by: Benny Ng |
last post by:
Dear All,
Now I just finished my winform application. And a part of that is to
send email reminder to the users. It's working fine in the server that with
SMTP service in Windows 2003.
But now...
|
by: |
last post by:
Hi all,
I am trying to send an email in some asp.net code and our SMTP Server
(EXchange) keeps kicking back with this message:-
Mailbox unavailable. The server response was: 5.7.1 Requested...
|
by: oliu321 |
last post by:
Hi,
First I am not trying to write a client to talk with hotmail
straightly. I am trying to write some codes to send emails through a
SMTP
server. I wrote a C++ version using pure socket...
|
by: =?Utf-8?B?dHBhcmtzNjk=?= |
last post by:
I have a web page that at the click of a button must send a bunch (1000+)
emails. Each email is sent individually. I have the code working fine,
using Mail Message classes and smtp and all that. ...
|
by: =?Utf-8?B?QWRl?= |
last post by:
HI All,
I am encountering the following error when I try to send an email through a
SMTP server. I believe the problem lies with the authentication part when the
network crednetials are used,...
|
by: =?Utf-8?B?TWlrZQ==?= |
last post by:
Hi,
I'm using this code for sending emails and its working fine because I had
configured SMTP in my machine in IIS.
now I'm using machine as a server for this application. but when running the...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
| |