473,668 Members | 2,519 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.Fro m properties
with something like "so******@someD omain.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*****@someDom ain.com";

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

eMail.To = "John Doe <jo*****@someDo main.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.co m> wrote in message
news:80******** *************** ***@posting.goo gle.com...
Rather than setting the MailMessage.To and MailMessage.Fro m properties
with something like "so******@someD omain.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*****@someDom ain.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
3465
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 "!<linefeed><space>" at about every 980th space. I have confirmed that these characters are not in the string or the message body before the email is sent. Has anyone seen this or have any thoughts? Thanks
4
1820
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 NEW so I don't have to retrieve them all. If you have experience with this kind of thing, you know that the server creates unique IDs for all the messages, but this IDs are not guaranteed to be unique, since they can be reused once a message is...
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; SmtpMail.SmtpServer=SMTPServer; but I keep getting back the error message "Could not access "CDO.Message" object.
6
2409
by: Eduardo Rosa | last post by:
Somebody knows how I queue email using .Net? thanks a lot
4
1421
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 added a reference System.Web. When I run the code I get warnings saying that System.Web.MailMessage is 'obsolete'. Alternative is System.Net.Mail.MailMessage When I change the System.Web.Mail to System.Net.Mail, I can't find any
3
4968
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 create message: MailMessage message = new MailMessage("mail@company.com", email); message.Subject = "Subject"; message.Body = ""; ContentType ct = new ContentType("application/vnd.ms-word"); Attachment data = new Attachment(ms,ct);
3
2328
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 I attempt to send an email using C#, I get a message that no email was sent. I have included the section of C# that covers this issue. Configure your POP email program.
2
2054
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 email but I am *unable* to show an alert message using JavaScript. Any ideas, please enlighten me. Thanks. Here is my code
6
2212
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 be done?
0
8889
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8570
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8650
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2781
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.