Recipients.Add generates Runtime error '287': Application-defined or object-defined error

后端 未结 2 1890
情书的邮戳
情书的邮戳 2021-01-17 05:30

I am testing how to send an e-mail. I have copied the code below from the help files:

Sub CreateHTMLMail()
\'Creates a new e-mail item and modifies its prope         


        
2条回答
  •  感动是毒
    2021-01-17 05:52

    Try this:

       toString = "me@email.com;you@email.com;them@email.com"
    
        With OutMail
            .To = toString
            .Subject = "Hello Friends"
            .Body = "Here is the email body"
            .Send
        End With
    

    This of course works with multiple recipients. For a single recipient, just do this:

    toString = "oneguy@gmail.com"
    

    And don't forget the .Send to actually make your email send.

提交回复
热议问题