View Single Post
  #3 (permalink)  
Old September 7th, 2009, 03:27 AM
phuc2583 phuc2583 is offline
Authorized User
Join Date: Dec 2007
Location: , , Vietnam.
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts

This is the whole my code that i want to do.

Shared Function SendMail(ByVal mailFrom As MailAddress, ByVal mailTo As MailAddress, ByVal strSubject As String, ByVal strContent As String, Optional ByVal CCaddress As String = "", Optional ByVal BCCaddress As String = "") As Boolean
Dim smtpClient As New SmtpClient()
Dim message As New MailMessage()
Dim kq As Boolean
'You can specify the host name or ipaddress of your server
'Default in IIS will be localhost |
smtpClient.Host = ""
message.From = mailFrom
If CCaddress.Length > 7 Then message.CC.Add(CCaddress)
If BCCaddress.Length > 7 Then message.Bcc.Add(BCCaddress)
message.IsBodyHtml = True
message.BodyEncoding = System.Text.Encoding.UTF8
message.ReplyTo = mailFrom
message.Priority = MailPriority.High
'Message body content
message.Subject = strSubject
message.Body = strContent
'Send SMTP mail
kq = True
'Catch ex As Exception
kq = False
'End Try
Return kq
End Function