PDA

View Full Version : Stopped Sending CC Emails


quang1234
04-04-2009, 01:16 PM
This piece of code is for sending email after customer has placed order. It works EXCEPT it just stopped sending the CC emails. I have xxxxxxed domains fields
Thank you

set iConf = server.createobject("CDO.Configuration")
set iMsg = server.createobject("CDO.Message")

iConf.fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
iConf.fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.XXXXXXXXX.com"
iConf.fields("http://schemas.microsoft.com/cdo/configuration/smtperverport") = 25
iConf.fields.update
set iMsg.configuration = iConf
iMsg.From = "YourOrderFromXXXXXXX.com"
iMsg.Subject = "Your order on " &web
iMsg.HTMLBody = strText
'iMsg.to = request.form("email")
iMsg.to = request.form("email") &" ; orders@XXXXXXX.com"

'Response.Write"email is: "& iMsg.to

iMsg.fields.update

iMsg.Send

hivelocitydd
04-04-2009, 03:29 PM
I would suggest you look at the documentation of CDO dll and confirm there is any way to include CC along with the To address. Mostly there should be some command to add CC apart from appending to the To address.

whammy
04-06-2009, 06:33 AM
If you're using CDONTS then


iMsg.cc = //insert email address variable here


"should" work.

I usually concatenate all the form input into an easily readable form, like so:


<% @Language="VBScript" %>
<% Option Explicit %>
<%

Dim objEmail, Sent, i, fieldName, fieldValue

If Request.Form("Email") <> "" Then

Sent = True 'boolean variable to use if you want to Response.Write that the message has been sent

Set objEmail = CreateObject("CDO.Message")

objEmail.From = "admin@yourwebsite.com"
objEmail.To = "recipient@whatever.com" 'or a user email's variable
objEmail.Cc = "whatever@wherever.com" 'copy
objEmail.Bcc = "whatever@wherever.com" 'blind copy
objEmail.Subject = "Contact message from Your Website"

For i = 1 to Request.Form.Count
fieldName = Request.Form.Key(i)
fieldValue = Request.Form.Item(i)
If fieldValue <> "" Then
objEmail.TextBody = objEmail.TextBody & (fieldName & ": " & fieldValue & vbCrLf)
End If
Next

With objEmail.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.yoursite.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "yourusername@yourwebsite.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "yourpassword"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

objEmail.Send

Set objEmail = Nothing

End If
%>


Hope this helps!

whammy
04-08-2009, 07:05 AM
Hmm, looks like these forums need a bit more spam protection from what I'm receiving via email.

:(