473,811 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send email to several recipients?

6 New Member
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 2023
Oralloy
988 Recognized Expert Contributor
You might try a list of addresses separated by commas (",") or semicolons (";").

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

click here
Jan 28 '11 #3
cpanelxp
6 New Member
click here to downlaod
Jan 28 '11 #4
Oralloy
988 Recognized Expert Contributor
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
9878
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 ********************************** package Celcom.Client;
8
2589
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 seem to regularly fail on have 9 and 11 characters respectively. Most users have names <= 8 characters. domain = "myDomainHere.com" admin = "d123456@%s" % domain adminFull = "Full Name Here <%s>" % admin def mailMsg(text, subject, sender,...
15
11063
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 : email@dom,email@dom,email@dom or: email@dom;email@dom;email@dom
9
4315
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, VisualStudio2002, VB as programing language. Our test/development version of the web app as hosted on our "localhost" works fine; our "Default SMTP Virtual Server" is running (per the IIS console).
2
2343
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 server response was: 550 5.7.1 Unable to relay for ........" now I tried to add username and password for the server to relay but it is still not working. this is the example i used:
5
8798
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 with this code: MailMessage msgMail = new MailMessage(); msgMail.To = "test@address.com"; msgMail.From = "from@address.com"; msgMail.Subject = "Mail Example Subject";
3
4561
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 windows application it worked fine, however I need to use a service as I don't want to rely on a user being logged in. The errors I get are: Index #:System.Web.HttpException: Could not access 'CDO.Message' object. --->...
1
5961
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 MyRS As Recordset Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment
2
1516
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 am having trouble finding code to send the email using the users default email or any email for that matter. I have done multiple searches on the subject but can't seem to find anything that works and the more I search the more confused I'm...
5
2375
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 name="safe_access"> <option value="0"></option> <option value="yes">Yes</option> <option value="no">No</option>
0
9726
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10647
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
10384
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
10395
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
9204
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6887
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
5553
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
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3017
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.