Dim strMsg As String=Args(0)
Dim strMailList As String=Args(1)
Dim strSend As String = ""
Dim strPW As String = ""
Dim cmd As new sqlcommand
cmd.c
cmd.CommandText = "Sel ect top 1 默认邮箱,邮箱授权码 from R系统设置表"
Dim Values = cmd.ExcuteValues
If Values.Count > 1 Then
strSend = Values("默认邮箱")
strPW = Values("邮箱授权码")
Else
msgbox("无法获取邮箱参数")
Return False
End If
Dim client As New System.Net.Mail.SmtpClient()
client.Host = "smtp.qq.com"
client.Credentials = New System.Net.NetworkCredential(strSend, strPW)
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network
Dim message As New System.Net.Mail.MailMessage
message.From = new System.Net.Mail.MailAddress(strSend)
Dim V2() As String
V2 = strMailList.split("|")
For i As Integer = 0 To V2.Length - 1
message.To.Add(V2(i))
Next
message.Subject = Date.today & "京超猫超商品销售信息 - 【无需回复】"
message.BodyEncoding = System.Text.Encoding.UTF8
message.IsBodyHtml = True
Dim body As String = "<html><body>内容</body></html>"
message.Body = body.Replace("内容", strMsg)
Try
client.Send(message)
msgbox("发送成功")
Catch ex As Exception
msgbox("发送失败:" & ex.message)
End Try
[此贴子已经被作者于2019/5/25 8:54:21编辑过]