Galera
Me ajuda, muito boa noite a todos.
Estou utilizando o código abaixo para envio de e-mails via Gmail, com smtp. Funciona lindo, mas gostaria de saber como adapto esse código pra usar no Outlook/Hotmail?
Me ajuda, muito boa noite a todos.
Estou utilizando o código abaixo para envio de e-mails via Gmail, com smtp. Funciona lindo, mas gostaria de saber como adapto esse código pra usar no Outlook/Hotmail?
- Código:
Sub SendGmail()
'creating a CDO object
Dim Mail As CDO.Message
Set Mail = New CDO.Message
'Enable SSL Authentication
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
'Make SMTP authentication Enabled=true (1)
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'Set the SMTP server and port Details
'Get these details from the Settings Page of your Gmail Account
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtp.gmail.com"
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Set your credentials of your Gmail Account
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = _
"edgar.massa.94@gmail.com"
Mail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = _
"********"
'Update the configuration fields
Mail.Configuration.Fields.Update
'Set All Email Properties
With Mail
.Subject = "Write subject here"
.From = "edgar.massa.94@gmail.com"
.To = "edgar_massa@hotmail.com"
'.CC = "user2@gmail.com"
'.BCC = "user3@gmail.com"
.textbody = "write your mail here"
'.AddAttachments ("Folder Address") 'To attach Documents in mail
End With
'to send the mail
Mail.Send
End Sub