469,328 Members | 1,327 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,328 developers. It's quick & easy.

CDO.Message email CC List problems

Hi,

This is driving me nuts to say the least!!!!!

I am trying to send an email from some server side ASP code and the CC field
is giving me some problems.

The code works fine if I have one or 2 email addresses in the field (The
addresses are valid.) However if I have 4 it breaks. Now the good
part......If I copy the 4 addresses (that were causing the problem) into the
field a few times, so basically I have 16 addresses the code works!!

I don't get an error back from the code when it breaks and I don't see any
emails in the Bad Email, Pickup or Queue folders, the email just doesn't
sent at all.

Also if I put the 4 addresses into the BCC field it works fine. It only
breaks on the CC field.

The code is included below, any help would be greatly appreciated.

Cheers,
P.

Dim cdoNewMail
Set cdoNewMail = safeServerCreateObject( "CDO.Message" )
' Populate its properties

'cdoNewMail.MailFormat = 0 ' MIME format
cdoNewMail.From = """" & FromName & """" & "<" & FromEmail & ">"
cdoNewMail.To = strToEmail

' Get the CC List
cdoNewMail.Cc = getCCList

cdoNewMail.Subject = Subject
cdoNewMail.HTMLBody = Body
'if the attachment file name is set then attach the file to the mail
If(strFileName <> "") Then
cdoNewMail.AddAttachment strFilePath
End If

' Send the message

cdoNewMail.Send

' Cleanup

Set cdoNewMail = Nothing
Jul 19 '05 #1
5 14136
what's the value of the field when it breaks?
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Paul Cheevers" <pa**@nospamaimware.com> wrote in message
news:O0**************@TK2MSFTNGP10.phx.gbl...
Hi,

This is driving me nuts to say the least!!!!!

I am trying to send an email from some server side ASP code and the CC field is giving me some problems.

The code works fine if I have one or 2 email addresses in the field (The
addresses are valid.) However if I have 4 it breaks. Now the good
part......If I copy the 4 addresses (that were causing the problem) into the field a few times, so basically I have 16 addresses the code works!!

I don't get an error back from the code when it breaks and I don't see any
emails in the Bad Email, Pickup or Queue folders, the email just doesn't
sent at all.

Also if I put the 4 addresses into the BCC field it works fine. It only
breaks on the CC field.

The code is included below, any help would be greatly appreciated.

Cheers,
P.

Dim cdoNewMail
Set cdoNewMail = safeServerCreateObject( "CDO.Message" )
' Populate its properties

'cdoNewMail.MailFormat = 0 ' MIME format
cdoNewMail.From = """" & FromName & """" & "<" & FromEmail & ">"
cdoNewMail.To = strToEmail

' Get the CC List
cdoNewMail.Cc = getCCList

cdoNewMail.Subject = Subject
cdoNewMail.HTMLBody = Body
'if the attachment file name is set then attach the file to the mail
If(strFileName <> "") Then
cdoNewMail.AddAttachment strFilePath
End If

' Send the message

cdoNewMail.Send

' Cleanup

Set cdoNewMail = Nothing

Jul 19 '05 #2
The value returned from the getCCList function is e.g.
su*****@companyname.com;su******@com...@company33.com;support
4@companyname.com

but if we took ANY email address off it would work.

Cheers,
P.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:Om*************@TK2MSFTNGP12.phx.gbl...
what's the value of the field when it breaks?
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Paul Cheevers" <pa**@nospamaimware.com> wrote in message
news:O0**************@TK2MSFTNGP10.phx.gbl...
Hi,

This is driving me nuts to say the least!!!!!

I am trying to send an email from some server side ASP code and the CC

field
is giving me some problems.

The code works fine if I have one or 2 email addresses in the field (The
addresses are valid.) However if I have 4 it breaks. Now the good
part......If I copy the 4 addresses (that were causing the problem) into

the
field a few times, so basically I have 16 addresses the code works!!

I don't get an error back from the code when it breaks and I don't see any emails in the Bad Email, Pickup or Queue folders, the email just doesn't
sent at all.

Also if I put the 4 addresses into the BCC field it works fine. It only
breaks on the CC field.

The code is included below, any help would be greatly appreciated.

Cheers,
P.

Dim cdoNewMail
Set cdoNewMail = safeServerCreateObject( "CDO.Message" )
' Populate its properties

'cdoNewMail.MailFormat = 0 ' MIME format
cdoNewMail.From = """" & FromName & """" & "<" & FromEmail & ">"
cdoNewMail.To = strToEmail

' Get the CC List
cdoNewMail.Cc = getCCList

cdoNewMail.Subject = Subject
cdoNewMail.HTMLBody = Body
'if the attachment file name is set then attach the file to the mail
If(strFileName <> "") Then
cdoNewMail.AddAttachment strFilePath
End If

' Send the message

cdoNewMail.Send

' Cleanup

Set cdoNewMail = Nothing


Jul 19 '05 #3
> safeServerCreateObject("CDO.Message")

What is this function?
cdoNewMail.From = """" & FromName & """" & "<" & FromEmail & ">"
Have you tried just using an e-mail address here, instead of the expanded
format?
cdoNewMail.Cc = getCCList
Can you show the code for this function or whatever builds this string?
cdoNewMail.Send


Do you have on error resume next going in this page? If so, try this:

on error resume next
cdoNewMail.Send
if err.number <> 0 then response.write err.description

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #4
Function safeServerCreateObject( strClassId )
Dim objInstance

On Error Resume Next
Set objInstance = Server.CreateObject( strClassId )

If ( Err.Number <> 0 ) Then

handleError "ServerCreateObject", Err.Number,
strClassId, Err.Description, "", ""

End If
On Error GoTo 0

Set safeServerCreateObject = objInstance

End Function

I tried using the email address for the 'cdoNewMail.From' and no luck.
The function getCCList is as follows

Public Function getCCList()

Dim arrCCList
arrCCList = ToCCEmail

Dim strCCList
strCCList = ""

Dim i

If ( VarType( arrCCList ) >= vbArray ) Then
For i = LBound( arrCCList ) To UBound( arrCCList )
strCCList = strCCList & arrCCList(i) & ";"
Next
Else
strCCList = ToCCEmail
End If

' Finished

getCCList = strCCList

End Function

Note when trying to debug this problem I've changed this line to be:
cdoNewMail.Cc =
"su*****@companyname.com;su******@company1.com;su* *****@company33.com;suppor
t
4@companyname.com"

I also added the on error resume next but it does not catch the 'Error'. In
fact I don't think the send method is retuning an error its just not sending
the emails!

Cheers,
P.

"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
safeServerCreateObject("CDO.Message")


What is this function?
cdoNewMail.From = """" & FromName & """" & "<" & FromEmail & ">"


Have you tried just using an e-mail address here, instead of the expanded
format?
cdoNewMail.Cc = getCCList


Can you show the code for this function or whatever builds this string?
cdoNewMail.Send


Do you have on error resume next going in this page? If so, try this:

on error resume next
cdoNewMail.Send
if err.number <> 0 then response.write err.description

--
http://www.aspfaq.com/
(Reverse address to reply.)

Jul 19 '05 #5
fixed it!!!

it was caused by our spam filtering on our exchange server!!!

"Paul Cheevers" <pa**@nospamaimware.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
Function safeServerCreateObject( strClassId )
Dim objInstance

On Error Resume Next
Set objInstance = Server.CreateObject( strClassId )

If ( Err.Number <> 0 ) Then

handleError "ServerCreateObject", Err.Number,
strClassId, Err.Description, "", ""

End If
On Error GoTo 0

Set safeServerCreateObject = objInstance

End Function

I tried using the email address for the 'cdoNewMail.From' and no luck.
The function getCCList is as follows

Public Function getCCList()

Dim arrCCList
arrCCList = ToCCEmail

Dim strCCList
strCCList = ""

Dim i

If ( VarType( arrCCList ) >= vbArray ) Then
For i = LBound( arrCCList ) To UBound( arrCCList )
strCCList = strCCList & arrCCList(i) & ";"
Next
Else
strCCList = ToCCEmail
End If

' Finished

getCCList = strCCList

End Function

Note when trying to debug this problem I've changed this line to be:
cdoNewMail.Cc =
"su*****@companyname.com;su******@company1.com;su* *****@company33.com;suppor t
4@companyname.com"

I also added the on error resume next but it does not catch the 'Error'. In fact I don't think the send method is retuning an error its just not sending the emails!

Cheers,
P.

"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
safeServerCreateObject("CDO.Message")


What is this function?
cdoNewMail.From = """" & FromName & """" & "<" & FromEmail &
">"
Have you tried just using an e-mail address here, instead of the expanded format?
cdoNewMail.Cc = getCCList


Can you show the code for this function or whatever builds this string?
cdoNewMail.Send


Do you have on error resume next going in this page? If so, try this:

on error resume next
cdoNewMail.Send
if err.number <> 0 then response.write err.description

--
http://www.aspfaq.com/
(Reverse address to reply.)


Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Spammay Blockay | last post: by
20 posts views Thread by Lucas Raab | last post: by
6 posts views Thread by Rylios | last post: by
2 posts views Thread by Tomdhu | last post: by
reply views Thread by Franz Steinhaeusler | last post: by
2 posts views Thread by sidaf | last post: by
2 posts views Thread by giotheninman | last post: by
3 posts views Thread by SAL | last post: by
5 posts views Thread by =?Utf-8?B?U3RldmUgQXVkdXMsIENoYXVjZXIgQkVDLCBTaGVm | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.