473,508 Members | 2,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Including name with eMail Adddress when using MailMessage Class

Rather than setting the MailMessage.To and MailMessage.From properties
with something like "so******@someDomain.com" I would like to include
the name along with the email address.

Is something like this possible to set the To property to send and
email to John Doe?

MailMessage eMail = new MailMessage();
eMail.To =@''John Doe[jo*****@someDomain.com";

Big thanks for any help on this.
Nov 15 '05 #1
1 2646
Try

eMail.To = "John Doe <jo*****@someDomain.com>";

That's how you'd usually set the to property in an email header.
Please note that I have not tried this out with .NET :)

/Brian

"CarlInAl" <go***@yahoo.com> wrote in message
news:80**************************@posting.google.c om...
Rather than setting the MailMessage.To and MailMessage.From properties
with something like "so******@someDomain.com" I would like to include
the name along with the email address.

Is something like this possible to set the To property to send and
email to John Doe?

MailMessage eMail = new MailMessage();
eMail.To =@''John Doe[jo*****@someDomain.com";

Big thanks for any help on this.

Nov 15 '05 #2

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

Similar topics

6
3444
by: mike | last post by:
I have created a side application in VB.NET which reads rows from a DB and builds an email message. when i have a long string the the mailmessage.body or the mailmessage, it puts in an...
4
1806
by: Madestro | last post by:
Hi guys, I am making a small program to retrieve e-mails from POP accounts. I got all the e-mail parsing stuff figured out, but I cannot seem to come up with a way to find out which e-mails are...
4
337
by: John S | last post by:
I have applied this code myMessage.To=MessageTo; myMessage.From=MessageFrom; myMessage.Subject=Subject; myMessage.Body=Body; myMessage.Priority=MailPriority.High;...
6
2397
by: Eduardo Rosa | last post by:
Somebody knows how I queue email using .Net? thanks a lot
4
1414
by: Reidar | last post by:
I am trying to send web email in vs2005, but haven't succeeded so far. I found an example in C# to make a Console application. The top of the code is using System; using System.Web.Mail; I have...
3
4957
by: TomislaW | last post by:
I am sending word document with e-mail from asp.net 2.0 application. I read doc file like this:FileStream fs = System.IO.File.Open(docPath,FileMode.Open,FileAccess.Read,FileShare.Read); Then...
3
2325
by: =?Utf-8?B?Um9iZXJ0IEUuIEZsYWhlcnR5?= | last post by:
Using .NET 2.0 in Visual Studio 2005, I am attempting to send an email. I am utilizing Yahoo as the SMTP provider. I am able to send emails using the setup instructions below using Outlook. When...
2
2046
by: Oltmans | last post by:
Hi All, I'm trying to send an HTML email from my asp.net 2.0 application. I want to show an "alert" message when user opens up my email message using JavaScript. Though I've been able to send...
6
2204
by: Jason | last post by:
I would like to build a windows app or service that would read a .txt file and than put the contents of that file in an email and send off the email. WOuld that be very difficult?...how could this...
0
7132
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...
0
7336
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,...
0
7401
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...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
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...
0
5640
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,...
1
5059
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...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.