Professional Documents
Culture Documents
Codevbd
Codevbd
email = "congtyhdq12c1@gmail.com"
password = "xfgldmxkpxciqcsn"
email_sent = "hieud3663@gmail.com"
With iConf.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =
587
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =
1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
email
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
password
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Update
End With
With iMsg
Set .Configuration = iConf
.To = email_sent
.From = "CÔNG TY HDQ 12C1 "
.Subject = "MÃ XÁC NHẬN"
.TextBody = "Mã xác nhận của bạn là: " & codex
.Send
End With
Debug.Print "sendmail"
Debug.Print codex
End Sub