I created a program in Access 2021. When an error occurs the user sends the error to me via the code below (which I got from this site). The code worked fine but the last time it tried to send the email attachment (text file) I got the following error:
" -2147220975: The message could not be sent to SMTP server. The transport error code was 0x80040217. The server response was not available "
I logged on to the outlook email with the username and password (actual not shown below) and had no issues. Can anyone help me figure out what happened?
Set emailObj = CreateObject("CDO.Message")
emailObj.From = "[email protected]"
emailObj.To = "[email protected]" '[email protected]
emailObj.Subject = "Error Log"
emailObj.TextBody = "From Debbie"
'emailObj.AddAttachment "c:\windows\win.ini"
emailObj.AddAttachment "C:\RDC-POS\Error Logs\ErrorLog.txt"
Set emailConfig = emailObj.Configuration
emailConfig.Fields(";) = 2
emailConfig.Fields(";) = 1
emailConfig.Fields(";) =
"smtp.office365"
'Exclude the following line
'emailConfig.Fields(";) = 587
emailConfig.Fields(";) = True
emailConfig.Fields(";) =
"[email protected]"
emailConfig.Fields(";) =
"xxxYY2008"
emailConfig.Fields.Update
emailObj.send
If Err.Number = 0 Then MsgBox "Email has been sent!"
End Sub
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745256889a4619011.html
评论列表(0条)