C# SMTP Mail question

J

Jason Huang

Hi,

In my C# Windows Form, TcpClient.
I can send mail with this one:

Mail From: Jason@com
Rcpt To: John@com
Data
From:AB
Subject:Topic AB
Test
..


However, this one doesn't work:

Mail From: Jason@com
Rcpt To: John@com
Data
From:A B
Subject:Topic AB
Test
..


The only difference is the
From:AB
From: A B

Would someone tell me how to fix it?
Thanks for help.


Jason
 
D

Daniel

What var is AB? You trying to set two froms? like from (e-mail address removed) and
(e-mail address removed)? Or is it just a name with a space in it? if so have you tried
doing this:

string myFromName = "Jason Orange";

Then set from to that. myMail.From = myFromName;

Let me know how you get on
 
J

Jason Huang

Thanks Daniel!
It is just a space in it.


Daniel said:
What var is AB? You trying to set two froms? like from (e-mail address removed) and
(e-mail address removed)? Or is it just a name with a space in it? if so have you tried
doing this:

string myFromName = "Jason Orange";

Then set from to that. myMail.From = myFromName;

Let me know how you get on
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top