473,383 Members | 1,737 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,383 software developers and data experts.

How to send email to several recipients?

hi,
I have programmed a software that can send email to one recipient with this code
In General Declaration I used this code

Expand|Select|Wrap|Line Numbers
  1. Imports System.Net.Mail
  2.  
In Form Declaration I used this code


Expand|Select|Wrap|Line Numbers
  1. Public Class Form1
  2.     Public D As MailMessage = New MailMessage
  3.     Public mail As New System.Net.Mail.SmtpClient("smtp.live.com")
  4.     Public myEmailAddress As String
  5.     Public myPassword As String
  6.  
under Button1_Click I used this code
Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim usernamepassword As New Net.NetworkCredential(Me.TextBox1.Text, Me.TextBox2.Text)
  3.                     Dim mailmsg As New MailMessage(Me.TextBox1.Text, Me.TextBox3.Text, Me.TextBox4.Text, Me.TextBox5.Text)
  4.                     mail.Port = "25"
  5.                     mail.Host = "smtp.live.com"
  6.                     mail.EnableSsl = True
  7.                     mail.Credentials = usernamepassword
  8.  
  9.                     mail.Send(Me.TextBox1.Text, Me.TextBox3.Text, Me.TextBox4.Text, Me.TextBox5.Text)
  10.                     MessageBox.Show("Email sended succesfull.")
how can I send email to SEVERAL recipients?
Jan 27 '11 #1
4 2003
Oralloy
987 Expert 512MB
You might try a list of addresses separated by commas (",") or semicolons (";").

What does it say in the documentation?
Jan 28 '11 #2
ok I'll send you the whole project
to see where's the error

click here
Jan 28 '11 #3
Oralloy
987 Expert 512MB
cpanel,

Sorry for the long delay. I work four days a week, so I'm usually off on Fridays.

Can you please attach the file as a .ZIP. The problem being that I don't have WinRAR, and I'll have to ask I.T. to install it on my system.
Jan 31 '11 #5

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

Similar topics

0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
8
by: dccarson | last post by:
Here is a snippet of code which does not send to all recipients. However, it also does not inform me of this error. My suspicion is that this only fails for users with longer usernames. The two I...
15
by: news.microsoft.com | last post by:
HI, ASPEmail to send to multiple recipients? I tried to use comma and semicolon but all the time give this message error: Error: 6 - 501 Bad address syntax nor :...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
2
by: Ron | last post by:
hi guys, I am trying to send email using smtpMail. I can send emails inside the organization, but out of the organization I get an error "The server rejected one or more recipient addresses. The...
5
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
1
by: Mr T | last post by:
I know how to send email from Access and I know how to create a custom form in Outlook. but.... How do I put the email info from Access into the Outlook custom form ??? Dim MyDB As Database Dim...
2
by: Lazareth | last post by:
Hi, I am trying to write a program to send email messages to selected recipients on a form when a button is clicked (each recipient has a checkbox) . The recipient section I can work out, but I...
5
by: canajien | last post by:
I have a form that stores information in a table, but I also need it to send an email when a specific question, among the many, is answered with no the question is a simple drop box: <select...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.