none
Can I create a "Submit" buttom to send to multiple email addresses that does not use Outlook as the mail server? RRS feed

  • Question

  • I am creating a form and would like to add a Submit button that will send to multiple addresses.  Some of those responding do not use Outlook as a mail server.  Most of those responding will be using Google and/or MSN as the mail server.  Is it possible to created a form that will do this without using Outlook?Thanks

    Thursday, September 24, 2015 5:37 PM

Answers

  • Hi BeckySF,

    >>Can I create a "Submit" buttom to send to multiple email addresses that does not use Outlook as the mail server?

    You could use CDO.Message to send email without outlook. Here is a simple demo to send email with gmail.

    Sub SendMail2()
    
        Set MyEmail = CreateObject("CDO.Message")
    
        MyEmail.Subject = "Subject"
        'multiple receiver
        MyEmail.To = "test@outlook.com;test@hotmail.com"
        'sender account
        MyEmail.From = "test@gmail.com"
    
        MyEmail.TextBody = "Testing one two three."
    
        Set emailConfig = MyEmail.Configuration
    
    
        emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    
        emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    
        emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    
        emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    
        emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    
        emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "test@gmail.com" 'user account
    
        emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "testpassword" 'user password
    
        emailConfig.Fields.Update
    
        MyEmail.Configuration.Fields.Update
    
        MyEmail.Send
    
        Set MyEmail = Nothing
    
    End Sub
    

    In addition, you need to add the reference Microsoft CDO with Tools->Reference.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, September 25, 2015 3:00 AM