VBS发邮件的小问题

来源:百度知道 编辑:UC知道 时间:2024/05/30 17:56:02
原来的代码是这样的:
'By Jerry Ye
On Error Resume Next
f=InputBox("From Email:","msg","username@163.com")
smtp=InputBox("SMTP:","msg","smtp.163.com")
u=InputBox("User:","msg","username")
p=InputBox("Pass:","msg","password")
t=InputBox("To Email:","msg","username@126.com")
m=InputBox("邮件主题:","msg","Test send mail")
msg=InputBox("邮件内容:","msg","Send success")
j=InputBox("附件路径:","msg","C:\test.rar")
NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
Set Email = createObject("CDO.Message")
Email.From = f
Email.To = t
Email.Subject = m
Email.Textbod

那还不简单,你把所有要用inputbox输入的地方改为确定的值不就行啦,比如

f=InputBox("From Email:","msg","username@163.com") 改为
xxx@163.com" '你的邮箱

smtp=InputBox("SMTP:","msg","smtp.163.com") 改为
smtp="smtp.163.com"

u=InputBox("User:","msg","username") 改为
u="username"

依次修改就行啦...