急,高手指导!!!! vfp 发送邮件

xuewuhen001 2012-05-14 06:44:17
WITH thisform.mAPISESS
.logonui=.F.
.downloadmail=.f.
.signon
ENDWITH
aa=GETFILE()
mymessage(aa)
thisform.maPIMESS.sessionID=thisform.maPISESS.sessionID
WITH thisform.mAPIMESS
.msgindex=-1
.compose
.recipdisplayname=ALLTRIM(thisform.text1.Value)
.msgsubject=ALLTRIM(thisform.text2.value)
.msgnotetext=thisform.edit1.Value
.attachmentindex=1
.AttachmentPathName=aa
.attachmenttype=1
.send(1)
ENDWITH
thisform.maPISESS.signoff


上述代码,运行send()方法时,老是出现,attachment not found 不知道是怎么回事
还请高手指点
...全文
207 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
都市夜猫 2012-05-15
  • 打赏
  • 举报
回复
先把 AttachmentType 属性改成 0 再说
另外,AttachmentIndex 属性是从 0 开始计数的
十豆三 2012-05-15
  • 打赏
  • 举报
回复
转帖:
用CDO发送邮件
*------------

There reason CDO2.0 avoids the security patch of Outlook is, it does not require Outlook to work. (Thank you Jonscott8 for this clarification)
Note #1 : This requires SMTP services installed and running on the local computer.
Note: If a mail server is involved (ie: Exchange server ) consider using the suggestions in FAQ184-1769.

oMSG = CREATEOBJECT('cdo.message')
oMSG.To = 'me@nowhere.com'
oMSG.From = 'me'
oMSG.Subject = 'Hello Email'
oMSG.TextBody = 'This is an easy way to create an email'
oMSG.Send()
release oMSG

*--带附件发送邮件
oMSG = createobject('CDO.Message')
oMSG.To = 'me@nowhere.com'
oMSG.From = 'me@nowhere.com'
oMSG.Subject = 'Hello Email'
oAtt=oMSG.AddAttachment('c:\myfile.txt')
oMSG.Send()
release oMSG

*--Here is a great way to embed your web page in your email:
CODEoMSG = createobject('CDO.Message')
oMSG.To = 'me@nowhere.com'
oMSG.From = 'me@nowhere.com'
oMSG.Subject = 'Hello Email'
oMSG.CreateMHTMLBody('http://www.slpcanada.com')
oMSG.Send()
release oMSG

*--发送HTML格式邮件
CODE
oMSG = createobject('CDO.Message')
oMSG.To = 'me@nowhere.com'
oMSG.From = 'me@nowhere.com'
oMSG.Subject = 'Hello Email'
oMSG.HTMLBody = [< b >< P >< FONT COLOR='#CC0000' >Hello In Color< /FONT >< /b >]
oMSG.Send()
release oMSG
xuewuhen001 2012-05-15
  • 打赏
  • 举报
回复
谢谢,都市夜猫、十豆三
xuewuhen001 2012-05-14
  • 打赏
  • 举报
回复
send()是mapimessage的内置方法
lygcw9602 2012-05-14
  • 打赏
  • 举报
回复
贴上SEND()方法代码

2,722

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧