Public Function Emilsend(ByVal arrp As Array) As Boolean
Dim tConsultname As String = G_objService.SB_MyTrim(arrp(0))
Dim tConsultTel As String = G_objService.SB_MyTrim(arrp(1))
Dim tConsultNote As String = G_objService.SB_MyTrim(arrp(2))
Dim ttyperr As String = G_objService.SB_MyTrim(arrp(3))
Dim tcompany As String = G_objService.SB_MyTrim(arrp(4))
Dim temail As String = G_objService.SB_MyTrim(arrp(5))
Try
Dim Strname1 As String
If ttyperr = "0" Then
Strname1 += "食品abcdefg"
Else
Strname1 += "化妆品abcdefg"
End If
'Dim StrEMail As String = "abcdefg@abcdefg.com;abcdefg@abcdefg.com"
Dim strFile As String = " Michael:" & vbCr & vbLf
strFile = strFile & vbCr & vbLf
strFile = strFile & tConsultNote & vbCr & vbLf
strFile = strFile & " Contactor:" & tConsultname & vbCr & vbLf
strFile = strFile & " Tel:" & tConsultTel & vbCr & vbLf
' Dim strFileOut As String = GetInfoOut(G_objService)
' Dim strFileInventory As String = GetInfoInventory(G_objService)
G_objService.Sys_WriteDebug("strFile", strFile)
'G_objService.Sys_WriteDebug("strFileOut", strFileOut)
'G_objService.Sys_WriteDebug("strFileInventory", strFileInventory)
sendMail("smtp.abcdefg.net", "abcdefg@tatiumsoft.com", "abcdefg", "", "abcdefg@tatiumsoft.com", "abcdefg@qq.com", Strname1, strFile)
'SendProjectEmailNew(G_objService, StrEMail, "" & Now.Date & "出入库货物查询日报表", strFile, strFileOut, strFileInventory)
'G_objService.Sys_EMailSendMail("smtp.abcdefg.com", "abcdefg@utclogistics.com.cn", "whsafe01", "abcdefg@utclogistics.com.cn", StrEMail, "", "", Now.Date & "安全库存日报表", "", "", "GB2312", strFile)
G_objService = Nothing
Return True
Catch ex As Exception
G_objService.Sys_WriteDebug("conTaskKey", "---" & ex.Message)
Return False
End Try
End Function
Public Sub sendMail(ByVal smtpserver As String, ByVal userName As String, ByVal pwd As String, ByVal nickName As String, ByVal strfrom As String, ByVal strto As String, ByVal subj As String, ByVal bodys As String, Optional ByVal isSSL As Boolean = True)
Try
Dim _smtpClient As New SmtpClient()
_smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network
_smtpClient.EnableSsl = True
_smtpClient.Host = smtpserver
_smtpClient.Port = 465
_smtpClient.UseDefaultCredentials = True
' 使用SMTP用户名和密码进行验证
_smtpClient.Credentials = New System.Net.NetworkCredential(userName, pwd) '用户名和密码
Dim _from As New MailAddress(strfrom, nickName)
Dim _to As New MailAddress(strto)
Dim _mailMessage As New MailMessage(_from, _to)
_mailMessage.Subject = subj '主题
_mailMessage.SubjectEncoding = System.Text.Encoding.UTF8
_mailMessage.Body = bodys '内容
_mailMessage.BodyEncoding = System.Text.Encoding.UTF8 '正文编码
_mailMessage.IsBodyHtml = False '设置为HTML格式
_mailMessage.Priority = MailPriority.Normal '优先级
_smtpClient.Send(_mailMessage)
Catch ex As Exception
G_objService.Sys_WriteDebug("sendMail", ex.Message)
End Try
End Sub