PDA

View Full Version : سوال: کد ایمیل



nikii66
دوشنبه 29 تیر 1388, 21:49 عصر
سلام من دارم یه پروژه با vb مینویسم احتیاج به یه کد دارم کدی که ایمیل رو طرف سرور بفرسته اگر میتونید برام بفرستید مرسی

945852620
یک شنبه 11 مرداد 1388, 21:05 عصر
Private Sub Command1_Click()
Dim iMsg, iConf, Flds, schema, SendEmailGmail
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

' send one copy with Google SMTP server (with autentication)
schema = "http://schemas.microsoft.com/cdo/configuration/"
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
Flds.Item(schema & "smtpserverport") = 465
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = "myName@gmail.com"
Flds.Item(schema & "sendpassword") = "myPassword"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update

With iMsg
.To = "Reciever"
.From = "Sender"
.Subject = "Subject"
.HTMLBody = "Text"
.Sender = "Sender"
Set .Configuration = iConf
SendEmailGmail = .Send
End With

Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

End Sub