11-02-2014، 11:37 PM
درود
دوست عزیز از این کد vbs استفاده کنید.
MailTo = "ایمیل به"
From = "از"
Subject = "موضوع"
Body = "بدنه."
Username = "یوزر نیم"
Password = "پسورد"
Email MailTo, From, Subject, Body, Username, Password
Sub Email (MailTo, From, Subject, Body, Username, Password)
Set objMessage = CreateObject("CDO.Message")
With objMessage
.Subject = Subject
.From = From
.To = MailTo
.TextBody = Body
End With
With objMessage.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = Username
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = Password
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 'change to 465 or 25if you get an error
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Update
End With
objMessage.Send
End Sub
دوست عزیز از این کد vbs استفاده کنید.
MailTo = "ایمیل به"
From = "از"
Subject = "موضوع"
Body = "بدنه."
Username = "یوزر نیم"
Password = "پسورد"
Email MailTo, From, Subject, Body, Username, Password
Sub Email (MailTo, From, Subject, Body, Username, Password)
Set objMessage = CreateObject("CDO.Message")
With objMessage
.Subject = Subject
.From = From
.To = MailTo
.TextBody = Body
End With
With objMessage.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = Username
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = Password
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 'change to 465 or 25if you get an error
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Update
End With
objMessage.Send
End Sub