Mustafa,
Here's the code I used to send the message..
class MailTest
{
[STAThread]
static void Main(string[] args)
{
MailMessage msg = new MailMessage();
msg.From = "Ross Jones <ross@mydomain>";
msg.To = "Ross Jones <ross@mydomain>";
msg.Subject = "Email test";
msg.BodyFormat = MailFormat.Text;
msg.Body = "This is my email test";
SmtpMail.SmtpServer = "customermail.easily.co.uk";
SmtpMail.Send( msg );
Console.WriteLine( " Message sent " );
}
}
The email comes through in Outlook as
Ross Jones [ross@mydomain]
The actual header looks like
From: "Ross Jones" <ro**@teamknowledge.co.uk>
If you like I could try out your code on my mail server to see what it does,
if you could trim the code down to the bare minimum.
Ross.
"Mustafa Rabie" <mr*******@hotmail.com> wrote in message
news:uQ**************@TK2MSFTNGP11.phx.gbl...
Hi Ross,
i tried that again and nuthing, the display name is not showing
i used
cmailMessage.To = "Mustafa Rabie <mr****@mydomain.com>" //where
cmailMessage is the message class
can you check if that's the same syntax u used?
thanks
"Ross Jones" <ro**@community.nospam> wrote in message
news:Oj**************@tk2msftngp13.phx.gbl... Hi,
I'm fairly sure I've had success using
Ross Jones < ro**@myaddress.com >
HTH.
"Mustafa Rabie" <mr*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... i tried that but no luck
any ideas?
thanks
"JMW" <JM*@discussions.microsoft.com> wrote in message
news:9F**********************************@microsof t.com...
> I dont remember the exact format but it is something like this (you
see it in web-mail) "Bill Gates [bg****@microsoft.com].
>
> jason.
>
> "Mustafa Rabie" wrote:
>
> > Hi,
> >
> > I am using the Smtp component that comes with the .Net framework.
I wanted
> > to know how can I set the Diaplay name of the user when sendind
the message?
> > e.g. "Mustafa" <mr****@mymail.com>
> > when i send a message i revice the email in the From but i want to
diaplay
> > both the Display name and the email address.
> >
> > Thanks
> > Mustafa
> >
> >
> >