MyMail.dll 函数发邮件碰到一个神奇的问题
//这是函数 MyMail.dll 需要网上下载
//声明
//Function Int MyUtil_SMTP_Connect(String host,Int port,String UserID,String Password) Library "MyMail.dll"
//Function Int MyUtil_SMTP_Disconnect() Library "MyMail.dll"
//Function Int MyUtil_SMTP_Msg_Init() Library "MyMail.dll"
//Function Int MyUtil_SMTP_Msg_SetInfo(Int i_type,Int i_sub_type,String as_text) Library "MyMail.dll"
//Function Int MyUtil_SMTP_Msg_Send() Library "MyMail.dll"
//
//1.通过网络发邮件
// (1) MyUtil_SMTP_Msg_Init
// (2) MyUtil_SMTP_Msg_SetInfo
// (3) MyUtil_SMTP_Connect
// (4) MyUtil_SMTP_Msg_Send
// (5) MyUtil_SMTP_Disconnect
String ls_host
Int li_port
String ls_userid,ls_passwd
ls_host = 'smtp.126.com'
li_port = 25
ls_userid = '******'
ls_passwd = '******'
Int li_ret
li_ret = MyUtil_SMTP_Msg_Init()
IF li_ret > 0 THEN
mle_1.Text += '1----成功:' + String(li_ret) + '~r~n'
ELSE
mle_1.Text += '1----失败:' + String(li_ret) + '~r~n'
END IF
MyUtil_SMTP_Msg_SetInfo(1,1,'*****@126.com')
MyUtil_SMTP_Msg_SetInfo(1,2,'张大山')
MyUtil_SMTP_Msg_SetInfo(2,1,'s****@qq.com')
MyUtil_SMTP_Msg_SetInfo(3,1,'这是我的测试主题' )
MyUtil_SMTP_Msg_SetInfo(5,1,'收到后请回复....')
MyUtil_SMTP_Msg_SetInfo(6,1,'F:\公司程序\pb邮件\2017-04-08.jpg')
MyUtil_SMTP_Msg_SetInfo(6,1,'F:\公司程序\pb邮件\2017-04-09.jpg')
MyUtil_SMTP_Msg_SetInfo(6,1,'F:\公司程序\pb邮件\2017-04-10.jpg')
li_ret = MyUtil_SMTP_Connect(ls_host,li_port,ls_userid,ls_passwd)
IF li_ret >= 0 THEN
mle_1.Text += '2----成功:' + String(li_ret) + '~r~n'
ELSE
mle_1.Text += '2----失败:' + String(li_ret) + '~r~n'
END IF
li_ret = MyUtil_SMTP_Msg_Send()
IF li_ret > 0 THEN
mle_1.Text += '3----成功:' + String(li_ret) + '~r~n'
ELSE
mle_1.Text += '3----失败:' + String(li_ret) + '~r~n'
END IF
MyUtil_SMTP_Disconnect()
写了一个小程序,用126测试,当在同一邮件发送一个附件时,
比如只写一个附件:MyUtil_SMTP_Msg_SetInfo(6,1,'F:\公司程序\pb邮件\2017-04-08.jpg')
在163邮箱里是看到有已发送的1个附件,
如果发送两个附件以上,比如写三个附件
MyUtil_SMTP_Msg_SetInfo(6,1,'F:\公司程序\pb邮件\2017-04-08.jpg')
MyUtil_SMTP_Msg_SetInfo(6,1,'F:\公司程序\pb邮件\2017-04-09.jpg')
MyUtil_SMTP_Msg_SetInfo(6,1,'F:\公司程序\pb邮件\2017-04-10.jpg')
发送成功之后,刷新查看163邮箱的已发送的邮件,发现这封邮件居然没有包含附件。而接收邮件那方,很正常的一样能收到所发的3个附件。 百思不得其解啊!
求哪位高人指点一下!