Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sending Emails using Macro

Hi guys

I want to send the mail from my company's EmailID to the someone's else company 's Email id  using macro .

Right now i can send the mail to all the Employee's of my company using macro, but how to send the mail to someone who is not in my company.

15 Replies
vikasmahajan

PFA

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author


Hi Manish,

Could u plz share your mail macro code for sending mails to same company id's.

Not applicable
Author

Hi ,

I am getting error "The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available "   on code line objMsg.Send

Please help me

thanks,

Kapil

Sub SendGMail1()

' Object creation
Set objMsg = CreateObject("CDO.Message")
Set msgConf = CreateObject("CDO.Configuration")

' Server Configuration
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "kapil_dadheech@gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "kapil1"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1

msgConf.Fields.Update

' Email
objMsg.To = "kapil_dadheech@gmail.com"
objMsg.From = "kapil_dadheech@gmail.com"
objMsg.Subject = "Test send with Gmail account"
objMsg.HTMLBody = "HTML/Plain text message."
objMsg.Sender = "Mr. Name"

Set objMsg.Configuration = msgConf

' Send
objMsg.Send

' Clear
Set objMsg = nothing
Set msgConf = nothing

End Sub

Not applicable
Author

Hi Vikas,

      We used that sending mail but after objMsg.Send  no response.

I given mail server settings also.

I need to send a excel sheet attachment in the mail from saved path.

Regards

Naren

Anonymous
Not applicable
Author

Hi guys

I'm trying to send email but happens the error "The transport failed to connect to the server."

Anyone could help me?

poojask123
Partner - Creator
Partner - Creator

Hi Vikas,

I used the code you shared, but the execution stops at ObjMsg.Send Can you please help?

Thanks