Grigoras
06-27-2008, 01:01 AM
:dunno Hi.I have a Excel macro which send mails, and addresses are get from a Excel cell.
The problem is:
If cell contain a single mail address everything is OK.(Ex.victor.grigoras@romtelecom.ro)
If cell contain more than an address (Ex.victor.grigoras@romtelecom.ro,marius.vasile@yahoo.com,gigi.radu@big.ro)
the mail client send mail only to the first address from cell.
Like a curiosity ,when I verify from Notes client if the mail was send,in To field appear all addresses but the difference is that the first address appear victor.grigoras@romtelecom.ro (with @.....) when other addresses appear without @........
Bellow is a part of macro.Cells with addresses are text formated
v = Cells(e, 13)
vaRecipient = v
j = Cells(e, 15)
vaCCRecipient = j
'Instantiate the Lotus Notes COM's Objects.
Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")
'If Lotus Notes is not open then open the mail-part of it.
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL
'Create the e-mail and the attachment.
Set noDocument = noDatabase.CREATEDOCUMENT
'Add values to the created e-mail main properties.
With noDocument
.Form = "Memo"
.SendTo = vaRecipient
.CopyTo = vaCCRecipient
.Subject = stSubject
.Body = vaMsg
.SaveMessageOnSend = True
End With
'Send the e-mail.
With noDocument
.PostedDate = Now()
.Send 0, vaRecipient
End With
'Release objects from the memory.
Set EmbedObject = Nothing
Set obAttachment = Nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing
The problem is:
If cell contain a single mail address everything is OK.(Ex.victor.grigoras@romtelecom.ro)
If cell contain more than an address (Ex.victor.grigoras@romtelecom.ro,marius.vasile@yahoo.com,gigi.radu@big.ro)
the mail client send mail only to the first address from cell.
Like a curiosity ,when I verify from Notes client if the mail was send,in To field appear all addresses but the difference is that the first address appear victor.grigoras@romtelecom.ro (with @.....) when other addresses appear without @........
Bellow is a part of macro.Cells with addresses are text formated
v = Cells(e, 13)
vaRecipient = v
j = Cells(e, 15)
vaCCRecipient = j
'Instantiate the Lotus Notes COM's Objects.
Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")
'If Lotus Notes is not open then open the mail-part of it.
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL
'Create the e-mail and the attachment.
Set noDocument = noDatabase.CREATEDOCUMENT
'Add values to the created e-mail main properties.
With noDocument
.Form = "Memo"
.SendTo = vaRecipient
.CopyTo = vaCCRecipient
.Subject = stSubject
.Body = vaMsg
.SaveMessageOnSend = True
End With
'Send the e-mail.
With noDocument
.PostedDate = Now()
.Send 0, vaRecipient
End With
'Release objects from the memory.
Set EmbedObject = Nothing
Set obAttachment = Nothing
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing