Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot send CC Mail 1

Status
Not open for further replies.

maesb

Technical User
Mar 25, 2003
30
JP
Hi.I'm trying to send out an email using the following to user1 and CC to user2. User1 is able to receive the email but not user2.

Set MyCDONTSMail2 = Server.CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title>Testing</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""FFFFFF"">"
HTML = HTML & "Ladies & Gentlemen"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
MyCDONTSMail2.From= "testing"
MyCDONTSMail2.To="user1@domain.com"
MyCDONTSMail2.Cc="user2@domain.com"
MyCDONTSMail2.Subject="Testing"
MyCDONTSMail2.BodyFormat=0
MyCDONTSMail2.MailFormat=0
MyCDONTSMail2.Body=HTML
MyCDONTSMail2.Send
set MyCDONTSMail2=nothing

Any idea?

Maegan.
 
it may be because the server doesn't understand what "testing" is becaquse it's not a vaild email address,
other than that looks good to me

Code:
<%
Set objMail = Server.CreateObject("CDONTS.NewMail")

msgBody
 = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">" & vbcrlf & _
       "<html>" & vbCrlf & _
       "<head>" & vbCrlf & _
       "<title>Testing</title>"
       "</head>" & vbCrlf & _
       "<body bgcolor=""FFFFFF"">" & vbCrlf & _
       "Ladies & Gentlemen" & vbCrlf & _
       "</body>" & vbCrlf & _
       "</html>"

objMail.From = "yousrservername@yourdomain.com"
objMail.To = "user1@domain.com"
objMail.CC = "user2@domain.com"
objMail.BCC = ""
objMail.Subject = "Testing"
objMail.BodyFormat=0
objMail.MailFormat=0
objMail.Body=HTML

objMail.Body = msgBody
objMail.Send
Set objMail = nothing
%>
 
not sure but maybe Cc is case sensitive in CDONTS try CC

good luck!
 
man i wish this forum had editing features...please add vbCrlf & _ after </title> if you test this code ;-)
 
Hi bslintx,

I've tried using small cap cc and now i've assigned the objMail.To , objMail.cc and objMail.From email to my email acc, which is valid. But so far i have only received 1 mail. The CC email just doesn't seem to be able to get through. I've even copied your code and try it out..

msgBody = msgBody & "<html>"
msgBody = msgBody & "<head>"
msgBody = msgBody & "<title>Testing</title>"
msgBody = msgBody & "</head>"
msgBody = msgBody & "<body bgcolor=""FFFFFF"">"
msgBody = msgBody & "Ladies & Gentlemen"
msgBody = msgBody & "</body>"
msgBody = msgBody & "</html>"

objMail.From = "maegan@mydomain.com"
objMail.to = "maegan@mydomain.com"
objMail.cc = "maegan@mydomain.com"
objMail.bcc = ""
objMail.Subject = "Testing 2"
objMail.BodyFormat=0
objMail.MailFormat=0
objMail.Body=HTML
objMail.Body = msgBody
objMail.Send
Set objMail = nothing

still doesn't work..

Maegan
 
have you tried sending a rich text format? strip the html, msgBody, bodyformat, mailformat because you don't need by default ...try sending to another address use my tek-tips name with yahoo ..i can't actually GIVE it to you because of tek-tips rules BUT like i said my name @ yahoo

Code:
<%
objMail.From = "this HAS to be vaild address on your smtp server NOT an address from hotmail, yahoo..etc"
objMail.to = "maegan@mydomain.com"
objMail.cc = "myscreenname@yahoo.com"
objMail.Subject = "Testing 2"
objMail.Send
Set objMail = nothing
%>

 
might just or the second email address is incorrect, try sending both to user1

an alt is to do


MyCDONTSMail2.To="user1@domain.com;user2@domain.com
 
true, that works but what if you want to send 1 to the boss and the other to workers; hence, CC'ing the workers or chain of command
 
dirregard steven...i see you're troubleshooting..sorry
 
you could also just create the mail feature in a function then just call it twice, thats the way i do it all the time, i don't think i've ever use cc or bcc

ex.

Code:
sendcdontsmail("user1@domain.com",fromvar,subjectvar,bodyvar)
sendcdontsmail("user2@domain.com",fromvar,subjectvar,bodyvar)
 
Thanks bslintx and steven290.. i've now striped off everything like what bslintx suggested and seems like it's working fine now.. but i'm still not sure what exactly cause it to go wrong in the first place.

I tried hardcoding the From, To and Cc to my own email account and it looks like if i do it that way, the Cc receiver will never get the mail cause the To and Cc are referring to the same email address.

i'm now putting back the original script piece by piece to see what happens..
 
bslintx, I'm just wondering, how did you place your codes into those neat textarea? is it by using the code tag?
<code>
Some codes here.
</code>
 
if in first post the 2nd email address was valid don't understand why it wouldn't work either....but you're now troubleshooting w/ the code that works now and eventually you'll catch the culprit. btw...if you didn't know you can embed asp variable values in the html. this is an awesome feature because you can literally make the email dynamic! any questions on that let us know....glad it's working/to cc now...good luck;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top