Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to sent email to multi users in vb.net2005?
Posted
Comments
Kschuler 21-Feb-11 9:22am    
If you really want help, you need to narrow down your question. It is too vague. Be more specific.

I'm sure you could find the answer in one of these CP Articles.[^] What specifically are you having trouble with? What have you tried? Can you post the code that isn't working?
 
Share this answer
 
Comments
BasharAyman 19-Feb-11 0:52am    
sorry I cant find the answar in cp articles
Sandeep Mewara 19-Feb-11 11:12am    
What asnwer you are looking for. We see you ask a question as "how to sent...".

There are lots of articles on web explaining the same. Now, what troubles you, how would we know until you tell us.
Sandeep Mewara 19-Feb-11 11:12am    
Good answer, exactly what question asked. 5!
In addition to Kschuler answer I am pointing two links Links1[^] and Links2[^] to go there and read thread to find out how to send email to multiusers
 
Share this answer
 
Comments
BasharAyman 20-Feb-11 0:51am    
still no right answar sorry
RaviRanjanKr 21-Feb-11 12:02pm    
if So then you need to describe what extras do you want and what is wrong in answer.
I would like to listen it. so Please!
Hello,
You can use this code to send email to from all mail servers

First you have to import 3 classes
Then create a new CLASSand put this code on it or use this code in a SUB
afte that you can call this class or sub and fill it
and you can seprate reciver (SendTo) email by ,

for example ( EmailSender("ir_digitalboy@yahoo.com","Morteza Shoja","you@name.con,menad@you.co,...",...

Good job.

Best Regards
Morteza Shoja

_______________________________________
Imports System.Net
Imports System.Net.Mail
Imports System.Net.Mime
_______________________________________
Private Sub EmailSender(ByVal From As String, ByVal DisplayName As String, ByVal SendTo As String, ByVal Message As String, ByVal Subject As String, ByVal Password As String, ByVal Attach As String)
Using mailMessage As New MailMessage(New MailAddress(SendTo), New MailAddress(SendTo))
mailMessage.Body = Message
mailMessage.Subject = Subject
Try
Dim SmtpServer As New SmtpClient()
SmtpServer.Credentials = New System.Net.NetworkCredential(From, Password)
SmtpServer.Port = 587

Dim MS() As String = From.ToString.Split("@")
Dim MailServer() As String = MS(1).ToString.Split(".")
Select Case UCase(MailServer(0))
Case Is = "GMAIL"
SmtpServer.Host = "smtp.gmail.com"
SmtpServer.EnableSsl = True
Case Is = "YAHOO"
SmtpServer.Host = "smtp.mail.yahoo.com"
SmtpServer.EnableSsl = False
Case Is = "AOL"
SmtpServer.Host = "smtp.aol.com"
SmtpServer.EnableSsl = False
Case Is = "LIVE"
SmtpServer.Credentials = New System.Net.NetworkCredential(From, Password)
SmtpServer.Host = "smtp.live.com"
SmtpServer.EnableSsl = True
End Select

mail = New MailMessage()
Dim addr() As String = SendTo.Split(",")
mail.From = New MailAddress(From, DisplayName, System.Text.Encoding.UTF8)
Dim i As Byte
For i = 0 To addr.Length - 1
mail.To.Add(addr(i))
Next i
mail.Subject = Subject
mail.Body = Message
mail.BodyEncoding = System.Text.Encoding.UTF7
If Attach.Length <> 0 Then
mail.Attachments.Add(New Attachment(Attach))
End If
mail.IsBodyHtml = True
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
mail.ReplyTo = New MailAddress(SendTo)
SmtpServer.Send(mail)
Catch ex As Exception
MessageBox.Show(ex.Message, "EMail", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try
End Using
End Sub
 
Share this answer
 
:mad:
d,mfvn,dsanb.ns/nb
rw
nh
nen

e
n
ent
ed
tn

etn

edtndtrmn
m
yr
tym

rym
r

m
rm
r
myrm
r
m
r

r
mj
r
m
r
m
r
my
r
m

rmy

yr
 
Share this answer
 
plz some one reply me
 
Share this answer
 
uppppppppppppppppppppppppppppppppppppppp
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900