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

后端 未结 2 1851
情书的邮戳
情书的邮戳 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:50

    Edit:
    As the OP states in his comment to my original answer, changing his code to

    .Recipients.To = "abc@xyz.com" 
    

    solved his problem. I leave my original answer below, because someone may learn from the mistake I made, pointed out by divo ;-)


    Original answer (careful, this is wrong!):

    Try enclosing the parameters passed to the Add method with parentheses:
    .Recipients.Add ("xyz@abc.com")

提交回复
热议问题