M
Marty
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: (e-mail address removed)
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
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: (e-mail address removed)
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