怎样利用outlook发送有附件的邮件?在线等待!
"rundll32.exe url.dll,FileProtocolHandler mailto:"+ls_addr+"?subject=courier&body=aaa!"
以上代码能实现对email地址、主题、正文的自动添加,但是附件怎么添加呢?
问题点数:50、回复次数:11Top
1 楼sywen(古道西风)回复于 2005-02-24 11:25:59 得分 0
兄弟們,怎麽沒人回答?!Top
2 楼zhaoangliuyan(刘琰)回复于 2005-02-24 11:53:05 得分 10
去网上找找看相关的例程吧,一看就会了。Top
3 楼sywen(古道西风)回复于 2005-02-24 11:55:56 得分 0
找不到啊,兄弟!Top
4 楼j9dai(翔)(DoItNow)回复于 2005-02-24 12:20:22 得分 10
看看OUTLOOK里有没有相关资料Top
5 楼sywen(古道西风)回复于 2005-02-24 13:21:48 得分 0
csdn沒有outlook欄啊!Top
6 楼hangzhou6274(拉面贵了,馒头小了,领导知道吗?)回复于 2005-02-24 16:28:44 得分 10
那你就用PB写一个好了啊Top
7 楼sywen(古道西风)回复于 2005-02-24 16:36:20 得分 0
自己寫的哪有outlook好用啊!Top
8 楼hangzhou6274(拉面贵了,馒头小了,领导知道吗?)回复于 2005-02-25 11:12:15 得分 10
现在的问题是你直接调用outllok解决不了问题啊,其实你自己写的也是通过outlook发送邮件的啊。Top
9 楼sywen(古道西风)回复于 2005-02-25 11:51:09 得分 0
自己upTop
10 楼hornbilltofy()回复于 2005-02-25 12:51:57 得分 10
先用pb把mailto的附件名动态生成一个网页,然后利用隐含的MS WEB浏览器控件去navigate这个网页就ok了Top
11 楼sywen(古道西风)回复于 2005-02-25 13:42:57 得分 0
自己解决,利用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"
代码
string host,uid,pwd
int port,ret
host="172.17.0.1" //服务器名
uid="t169" //发件人登陆发件服务器时的用户名
pwd=".t169" //发件人登陆发件服务器时的密码
port=25 //发送服务器的smtp端口号,没改的话一般是25
//邮件初始化:
if MyUtil_SMTP_Msg_Init()<0 then
MessageBox("info","Init Failed");
end if
if MyUtil_SMTP_Msg_SetInfo(1,1,"zxw-sz@hhop.com.hk")<0 then
MessageBox("info","Set info1 Failed")
end if
if MyUtil_SMTP_Msg_SetInfo(1,2,"zxw")<0 then
MessageBox("info","Set info2 Failed")
end if
if MyUtil_SMTP_Msg_SetInfo(2,1,"zxw-sz@hhop.com.hk")<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,"e:\13.pdf")<0 then
MessageBox("info","Set info5 Failed")
end if
if MyUtil_SMTP_Connect(host,port,uid,pwd)<0 then
messageBox("info","连接失败!")
end if
if MyUtil_SMTP_Msg_Send()<0 then
MessageBox("info","发送失败!")
else
Messagebox('Info','发送成功!')
end if
if MyUtil_SMTP_Disconnect()<0 then
MessageBox("info","disconnect failed")
end ifTop




