Forum Discussion

Lance_101's avatar
Lance_101
Occasional Contributor
5 years ago

SendMail Not Working When Sending Multiple Attachments

Hello, we're having trouble using the builtin function SendMail when sending more than one attachment. It works fine if we simply call the function and pass in our arguments. But when we call the fun...
  • JuliaBernikova's avatar
    JuliaBernikova
    5 years ago

    Hi Lance,

     

    The CDO object is indeed no longer actively maintained by Microsoft, but you can still use it for sending emails (the schema still works even though its URL cannot be opened in a browser). Besides, using CDO allows you to specify the SMTP server port and use SSL for SMTP connections.

     

    As for the original issue with multiple attachments, it looks like the issue was with the parameter type. The SendEmail method expects each string to be passed individually, but instead, an entire array of strings was passed in a single parameter. At the same time, SendEmail always uses port 25 and doesn't allow using SSL, so it looks like using CDO will be a more appropriate solution.