找回密码
 加入
搜索
查看: 4794|回复: 17

电子邮件附件自动上传脚本

  [复制链接]
发表于 2008-5-21 09:51:10 | 显示全部楼层 |阅读模式
用autoit有没有这个可能制作这样的脚本呢?
指定一个(某个或特定的一个)电子邮件的用户名和密码,给出要上传的文件列表(带路径),能否自动上传全部文件?
具体是要求自己给自己发一封带附件的邮件。一封电子邮件只带一个附件。
有没有可能做出这样的脚本?

[ 本帖最后由 jiataifeng 于 2008-5-22 10:49 编辑 ]
 楼主| 发表于 2008-5-21 10:05:53 | 显示全部楼层
呵呵,谢谢回复::)
 楼主| 发表于 2008-5-21 11:36:07 | 显示全部楼层
你说的UDF我找到了。
可以发送邮件,但不可以发送附件。怎么回事啊。
高手看看啊
#include <SmtpMailer.au3>
$s_SmtpServer = "smtp.gmail.com" ; smtp服务器 address for the smtp-server to use - REQUIRED
$s_FromName = "myname" ; 邮件发送人 name from who the email was sent
$s_FromAddress = "myusrnme@gmail.com" ; 邮件发送者地址address from where the mail should come
$s_ToAddress = "myusrnme@gmail.com" ; 邮件发送给谁 destination address of the email - REQUIRED
$s_Subject = "autoittest" ;邮件标题 subject from the email - can be anything you want it to be
$as_Body = "autoittest" & @CRLF & _
"http://bbs.yidabu.com/forum-2-1.html" ; 邮件正文the messagebody from the mail - can be left blank but then you get a blank mail
$s_AttachFiles = "" ; 附件地址 the file you want to attach- leave blank if not needed
$s_CcAddress = "" ; address for cc - leave blank if not needed
$s_BccAddress = "" ; address for bcc - leave blank if not needed
$s_Username = "myusrnme" ; 用户名 username for the account used from where the mail gets sent - REQUIRED
$s_Password = "mypass" ; 密码password for the account used from where the mail gets sent - REQUIRED
$IPPort=465 ; yidabu.com提示:Gmail使用的发送端口 
$ssl=1 ; yidabu.com提示:Gmail要启用安全连接 

Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
If @error Then
MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
EndIf

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2008-5-21 21:43:54 | 显示全部楼层
再顶下。有没有能明白的呢
发表于 2008-5-21 21:47:39 | 显示全部楼层
发送附件还要自动化= =|||
 楼主| 发表于 2008-5-21 21:58:07 | 显示全部楼层
我目的就是自动发送附件的啊。。。
我本意是想把自己的某些软件自动分包压缩,然后批量上传到电子邮件里保存。一个一个发,很麻烦的啊。
 楼主| 发表于 2008-5-22 00:09:27 | 显示全部楼层
再顶一下,真的无法解决?
发表于 2008-5-22 10:35:59 | 显示全部楼层
附件是可以发的,这事我干过


[ 本帖最后由 bob 于 2008-5-22 10:41 编辑 ]
 楼主| 发表于 2008-5-22 10:49:22 | 显示全部楼层
已经搞定,但不是用autoit。
发表于 2008-6-11 10:00:44 | 显示全部楼层
不是用的autoit是用的什么?
说出来啊
发表于 2008-6-11 21:34:39 | 显示全部楼层
$s_AttachFiles = "" ; 附件地址 the file you want to attach- leave blank if not needed
这不是附件吗?
我试了下发一个文本文件的附件是可以的.

另外楼主是通过什么解决的,我也想知道.
发表于 2009-11-13 19:43:56 | 显示全部楼层
顶一下,真的无法解决?
发表于 2009-11-13 21:30:39 | 显示全部楼层
$s_AttachFiles = "" ; 附件地址 the file you want to attach- leave blank if not needed
这不是附件吗? ...
AutoIter 发表于 2008-6-11 21:34



    这个好用啊
发表于 2010-6-28 21:09:02 | 显示全部楼层
支持,顶顶
发表于 2010-9-12 11:14:48 | 显示全部楼层
顶一下,附件路径可能输入有误
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 03:20 , Processed in 0.090675 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表