//使用例程:
string host,uid,pwd,ls_error
int port,ret
host="smtp.yeah.net" //服務器名
uid="fcfwzx" //發件人登陸發件服務器時的用戶名
pwd="********" //發件人登陸發件服務器時的密碼
port=25 //發送服務器的smtp埠號,沒改的話一般是25
//郵件初始化:
if MyUtil_SMTP_Msg_Init()<0 then
MessageBox("info","Init Failed");
end if
if MyUtil_SMTP_Msg_SetInfo(1,1,"[email protected]")<0 then
MessageBox("info","Set info1 Failed")
end if
if MyUtil_SMTP_Msg_SetInfo(1,2,"飛")<0 then
MessageBox("info","Set info2 Failed")
end if
if MyUtil_SMTP_Msg_SetInfo(2,1,"[email protected]")<0 then
MessageBox("info","Set info3 Failed")
end if
if MyUtil_SMTP_Msg_SetInfo(3,1,"帶附件的郵件!")<0 then
MessageBox("info","Set info4 Failed")
end if
if MyUtil_SMTP_Msg_SetInfo(5,1,"這是郵件的正文!")<0 then
MessageBox("info","Set info5 Failed")
end if
// if MyUtil_SMTP_Msg_SetInfo(5,1,"這是郵件的正文!")<0 then
// MessageBox("info","Set info5 Failed")
// end if
// if MyUtil_SMTP_Msg_SetInfo(6,1,"d:\used\test.pbw")<0 then
// MessageBox("info","Set info5 Failed")
// end if
if MyUtil_SMTP_Connect(host,port,uid,pwd)<0 then
messageBox("info","connect Failed")
end if
if MyUtil_SMTP_Msg_Send()<0 then
MessageBox("info","send failed")
ls_error=space(2000)
MyUtil_GetLastError(ls_error)
messagebox('',ls_error)
end if
if MyUtil_SMTP_Disconnect()<0 then
MessageBox("info","disconnect failed")
end if
運行到發送的時候就顯示錯誤,錯誤內容:bad sequence of commands"那位高手指點一下,先謝謝
uj5u.com熱心網友回復:
現在很多郵件服務器都要認證的,mail 剛好沒有認證這個功能,去找個不用認證的就行了,如何處理論證方法我也在找 ,轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/87828.html
標籤:API 調用
