32 Replies Latest reply: Jul 27, 2015 7:12 PM by bon kornwit RSS

    Email sending not working

      Why this this function not working?

      function sending()
      Set objMessage = CreateObject("CDO.Message")
      objMessage.Subject = "Subject"
      objMessage.From = "test1@gmail.com"
      objMessage.To = "test2@gmail.com"

      objMessage.TextBody = "Body"

      objMessage.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

      objMessage.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"


      objMessage.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/sendusername ") ="test1@gmail.com"

      objMessage.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/sendpassword ") ="password"

      objMessage.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

      objMessage.Configuration.Fields.Item _
      ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465

      objMessage.Configuration.Fields.Update

      objMessage.Send
      end function