Dim mSmtpClient As New SmtpClient(S_Smtp, S_port) Dim mMailmessage As New MailMessage Try mSmtpClient.Credentials = New System.Net.NetworkCredential(S_User, S_pass) mMailmessage.ReplyToList.Add(New MailAddress(S_replyto)) mMailmessage.From = New MailAddress(sender & "<" & S_User & ">") mMailmessage.Subject = subject Dim Overallmail As Integer = str.Rows.Count '-------------------start Sending--------------------------------------------------------- For i = 0 To str.Rows.Count - 1 Dim bodymail As String = body email = str.Rows(i).Item(0).ToString bodymail = bodymail.Replace(oldmail, email).Replace("[email]", email) htmlView = System.Net.Mail.AlternateView.CreateAlternateViewFromString(bodymail, Nothing, "text/html") 'mSmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network mMailmessage.AlternateViews.Add(htmlView) mMailmessage.IsBodyHtml = True 'execute too fast to see the thread working. mMailmessage.[To].Add(New MailAddress(email)) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' mSmtpClient.Send(mMailmessage) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' mMailmessage.To.Clear() mMailmessage.AlternateViews.Clear() Thread.Sleep(oXMLparams.GetParamValue("EmailEvery")) End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)