Home > Software engineering >  Cdo email always appear - 2147220973, please look at the code
Cdo email always appear - 2147220973, please look at the code

Time:09-23

 Public Function sendmail (mails As String, mailt As String) As an Integer 
On Error GoTo error_1
StrName="http://schemas.microsoft.com/cdo/configuration/"
Dim objEmail As Object
The Set objEmail=CreateObject (" cdos. The Message ")
ObjEmail. From=mailfrom '" [email protected] "From
'objEmail. To="[email protected]" To
ObjEmail. To=mailto '" [email protected] "To
ObjEmail. Subject=mails'
email Subject'objEmail. Textbody=mailt email body
ObjEmail. HtmlBody send HTML
=mailt ''qq oupgitmtklxyciej aidrphzvlfdechda

ObjEmail. Configuration. Fields. The Item (strName & amp; "Sendusing")=2
ObjEmail. Configuration. Fields. The Item (strName & amp; "Smtpserver")=mailsmtp '" smtp.vip.163.com "' SMTP server
ObjEmail. Configuration. Fields. The Item (strName & amp; "Smtpserverport")=mailport
ObjEmail. Configuration. Fields. The Item (strName & amp; "Smtpauthenticate")=1
ObjEmail. Configuration. Fields. The Item (strName & amp; "Smtppusessl") whether to use SSL=mailssl 'string
ObjEmail. Configuration. Fields. The Item (strName & amp; "Sendusername")=mailuser
ObjEmail. Configuration. Fields. The Item (strName & amp; "Sendpassword")=mailpass
ObjEmail. Configuration. Fields. The Update
ObjEmail. Send
The Set objEmail=Nothing
The sendmail=1
T1=0
The Exit Function
Error_1:
Call xlog (" sendmail "& amp; Err, Description & amp; "" & amp; Err. Number)

'If Err=- 2147220973 Then
The sendmail=0
T1=0
'End If
End the Function



The Public Function sendmailf (mails As String, mailt As String, n As an Integer) As an Integer
On Error GoTo error_1
StrName="http://schemas.microsoft.com/cdo/configuration/"
Dim objEmail As Object
The Set objEmail=CreateObject (" cdos. The Message ")
ObjEmail. From=mailfrom '" [email protected] "From
'objEmail. To="[email protected]" To
ObjEmail. To=mailto '" [email protected] "To
ObjEmail. Subject=mails'
email Subject'objEmail. Textbody=mailt email body
ObjEmail. HtmlBody send HTML
=mailt 'The Select Case n
Case 1
File2. Path="C: \ bak"
ObjEmail. AddAttachment "C: \ bak " + File2. List (File2. ListCount - 1)

Case 2
File1. Path="C: \ bak2"
ObjEmail. AddAttachment "C: \ bak2 \ SKM BMP" '+ File1. List (File1. ListCount - 1)

End the Select
ObjEmail. Configuration. Fields. The Item (strName & amp; "Sendusing")=2
ObjEmail. Configuration. Fields. The Item (strName & amp; "Smtpserver")=mailsmtp '" smtp.vip.163.com "' SMTP server
ObjEmail. Configuration. Fields. The Item (strName & amp; "Smtpserverport")=mailport
ObjEmail. Configuration. Fields. The Item (strName & amp; "Smtpauthenticate")=1
ObjEmail. Configuration. Fields. The Item (strName & amp; "Smtpusessl")=mailssl
ObjEmail. Configuration. Fields. The Item (strName & amp; "Sendpassword")=mailpass
ObjEmail. Configuration. Fields. The Update
ObjEmail. Send
The Set objEmail=Nothing
Sendmailf=1
T1=0
The Exit Function
Error_1:
Call xlog (" sendmailf "& amp; Err, Description & amp; "" & amp; Err. Number)

Sendmailf=0

'End If
End the Function


Both the process of sending mail, SMTP server is smtp.vip.163.com, vip163 mailbox, actual operation, five intervals of 1 minute a mails only received two letters with attachments, no letter received with attachments, sometimes strange received a letter without attachment
The error information is basic in the sendmail process, err. The number is - 2147220973

O? , t??? Present mu? '? E? A???? Oeu? On
- 2147220973

CodePudding user response:

Not add do not add attachments, tried a few other E-mail and attachments as not receive, is it the mail content? Are all the same is an HTML table

CodePudding user response:

http://blog.sina.com.cn/s/blog_6cc953fd010190fu.html
Network stability is bad, Microsoft's web site to access is slow

CodePudding user response:

CodePudding user response:

refer to the second floor bakw response:

http://blog.sina.com.cn/s/blog_6cc953fd010190fu.htmlNetwork stability is bad, Microsoft's web site to access is slow


StrName="http://schemas.microsoft.com/cdo/configuration/"
This is a Microsoft transit? Every email sent to a Microsoft first, reoccupy from Microsoft's server?
  • Related