473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

C# Web Help with sending E-mail to multiple recipients

I am not able to get an e-mail sent to multiple recipients. I am using C# in VS 2003.

Here is the code:

MailMessage mail = new MailMessage();
mail.To = "address1@somewhere.com;address2@somewhere.com ";
mail.Cc="address3@somewhere.com";
mail.From = "My Program";
mail.Subject = "Alert";
mail.Priority = MailPriority.High;
mail.BodyFormat = MailFormat.Text;
mail.Body = sMessage;
SmtpMail.SmtpServer = "mymailserver.somewhere.com";
SmtpMail.Send(mail);

When using this the message gets sent to address1 and address3 but not address2. I have also tried using a comma in place of the semicolon with no luck. I am at a loss as I get no error message and everything I have looked up says that this is correct and should work. Any help would be apprectiated.

Thanks
Nate
Mar 28 '08 #1
2 2411
Plater
7,872 Expert 4TB
Well the MSDN on that isn't very good since they obsoleted it.
Their examples don't seem to lend it as a possibility that you can do multiple recipients though.
However using trickery I found this:
[quote=MSDN for System.Web.Mail.MailMessage.To]
Property Value
A semicolon-delimited list of e-mail addresses.
[/code]

Are your addresses all valid?
Mar 28 '08 #2
kenobewan
4,871 Expert 4TB
This does work, I'd guess that Plater is right the problem is with the email address3. Try replacing it with your own - in fact you may want to ensure none of them are live or you may get accused of spamming :).
Mar 29 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: NotGiven | last post by:
The code below is designed to loop through rows of a database query obtaining email addresses and send an email to each. It is modified form fomr some code I found on the net. With each while...
1
by: fishboy | last post by:
Howdy, I'm in middle of a personal project. Eventually it will download multipart binary attachments and look for missing parts on other servers. And so far I've got it to walk a newsgroup and...
1
by: Gidi | last post by:
Hi, i have a textBox that when it get focused i'm sending ALT+SHIFT (to change the current language) i compare the current language to the one i need (using InputLanguage.CurrentInputLanguage),...
2
by: Dee | last post by:
Hi I have added EnableViewStateMac="false" to the sending WebForm's @Page Directive and my sample code has the following line: Dim coll As...
8
by: Amol | last post by:
Hi , I am developing a web application.I need an interface in my application which will allow the user to send the fax domestic /international.I dont want to use 3rd party tool /service .Does...
1
by: rich | last post by:
Hi all, I have a fairly complex "feed" application that recieves messages from an external user-supplied API via a callback function, and attempts to forward these messages to another...
0
by: remya1000 | last post by:
by using FTP i can send files to server using vb.net. if the file is big, then it will take some time to complete the sending process to server.or if we were sending 3-4 files to the server one by...
4
by: srivineel | last post by:
Hello EveryBody I need to send sms from dotnet application to my mobile. For this task i have gone through the material on the net. Iam getting good info abt this. And in ...
0
by: Vajrala Narendra | last post by:
in the i got few problems please solve to help me also send information regarding email sending. Try Dim mailbody As String mailbody = "" mailbody =...
3
by: senthurganesh | last post by:
Hai Am Developing SMS Sending Application using C#.Net. MY Problem Is Sending SMS via COM3.But It Throw Different Exception . Till Now Am Didn't Face That Problem. Am Connect The Mobile...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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,...

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.