ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel VBA using Sendmail to Send to Distribution List (https://www.excelbanter.com/excel-programming/388279-excel-vba-using-sendmail-send-distribution-list.html)

belkingold

Excel VBA using Sendmail to Send to Distribution List
 
I am trying to use the SendMail function in Excel VBA to send the
workbook as an attachment to a distribution list. The distribution
list contains spaces, and it keeps coming back as an unknown
recipient. Here's the code, it's pretty simple:

ActiveWorkbook.SendMail _
Recipients:=EmlAddr & ";" & CCAddr, _
Subject:=FleNme


The variables:

EmlAddr = "
CCAddr = " CCI HRD - LNP Support"

I realize, of course that this is all going in to the To: line and
that you can't use an actual CC with sendmail, but that's not really a
big deal to me. CCAddr is the distribution list.

Any suggestions?


Dave Peterson

Excel VBA using Sendmail to Send to Distribution List
 
How about:

Recipients:=array(EmlAddr, CCAddr)

(untested)

belkingold wrote:

I am trying to use the SendMail function in Excel VBA to send the
workbook as an attachment to a distribution list. The distribution
list contains spaces, and it keeps coming back as an unknown
recipient. Here's the code, it's pretty simple:

ActiveWorkbook.SendMail _
Recipients:=EmlAddr & ";" & CCAddr, _
Subject:=FleNme

The variables:

EmlAddr = "
CCAddr = " CCI HRD - LNP Support"

I realize, of course that this is all going in to the To: line and
that you can't use an actual CC with sendmail, but that's not really a
big deal to me. CCAddr is the distribution list.

Any suggestions?


--

Dave Peterson


All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com