Hi Christian, First-of-all thanks for replying... there is no issue to put the code and here is my code...
Dim Strsmtp As New System.Net.Mail.MailMessage
' MailFrom and MailTo come from the database
Dim from As New System.Net.Mail.MailAddress(objReader("MailFrom").ToString())
' Here i Put hard code emailids
Dim toList As New System.Net.Mail.MailAddress("abc1@abc.com;abc2@abc.com")
Strsmtp.From = from
Strsmtp.To.Add(toList)
Strsmtp.Subject = "Hi"
Strsmtp.IsBodyHtml = True
Strsmtp.Headers.Add("Content-Type", objReader("MailContentType"))
Strsmtp.Headers.Add("Reply-To", objReader("MailReplyTo"))
Strsmtp.Body = "Test"
Dim sp As New System.Net.Mail.SmtpClient()
sp.Send(Strsmtp)
and when i put the single emailid, then it gives different error that - Host Name is not specified. But i already specified host name in my web.config file. Here is the code..
<system.net>
<mailSettings>
<smtp>
<network host="localhost" />
</smtp>
</mailSettings>
</system.net>
as i work in my local pc, so i write "localhost"... Now i don't understand what i have to do???:confused:
Krishnraj