Discussion board where members can get started with QlikView.
Usually refers to an network error. Reyling allowed on the smtpserver? Try with IP-adress instead of DNS name. Make sure it's the correct port for the smtp server.
Please note that you are creating a CDO-object so you need to have collaboration data objects installed on the machine running the macro. I'm not 100% sure on this but I believe MS stopped shipping CDO since Outlook 2007 so you would need to manually install it.
I tried following script. But all the time I am getting error "ActiveX component can't create object: 'CDO.Message' ".
Can anybody please tell me URGENTLY what is going wrong ??
' 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") = "email@example.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
objMsg.To = "firstname.lastname@example.org"
objMsg.From = "email@example.com"
objMsg.Subject = "Test send with Gmail account"
objMsg.HTMLBody = "HTML/Plain text message."
objMsg.Sender = "Mr. Name"
Set objMsg.Configuration = msgConf
Set objMsg = nothing
Set msgConf = nothing
I'm trying to send email from an address in the domain of my company to an outside address (in another domain but also on address like gmail or yahoo...). I tried your solution (and many others !) but I haven't find the good solution.
(The same macro works well to send email in the same domain and from a GMail account to other address)
Does someone find the solution ?
I'm guessing you are running into relay problems.
Usually you can debug it by open up a telnet promp and try to send the same e-mail, you will get some more detailed error information.
By default you aren't allow to relay e-mails of your exchange smtp server to outside domains so this is likely something you need to turn on.
The code works perfectly. However, it is using schema.microsoft .... where my scenario is, the server has blocked internet access, besides sending the mail to exchange server (within the same domain). Is there any reference on macro, for sending mail using SMTP to exchange server? I have tested the SMTP mail through QMC, it works though.