Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - BCC Problem

Reply
 
Old 08-29-2009   #1 (permalink)
GarryJones


 
 

BCC Problem

A problem with bcc, probably syntax

The following code works

Set objMail = Server.CreateObject( "CDONTS.NewMail" )
objMail.To = "i...@xxxxxx; "&request.Form("email")
objMail.From = "i...@xxxxxx"
objMail.Subject = "From us!"

It sends to "to " and the adress collected on the form

Now I need to add a bcc. I tried

Set objMail = Server.CreateObject( "CDONTS.NewMail" )
objMail.To = "i...@xxxxxx; "&request.Form("email")
objMail.Bcc = "m...@xxxxxx"
objMail.From = "i...@xxxxxx"
objMail.Subject = "From us!"

It sends to "to " and 2 copies to the the adress collected on the form
but none to the newly added bcc.

Any help greatly appreciated.

Garry Jones
Sweden

My System SpecsSystem Spec
Old 08-29-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: BCC Problem


"GarryJones" <morack@xxxxxx> wrote in message
news:afe3a41e-519e-49fd-9ed6-5f2e51269200@xxxxxx
Quote:

>A problem with bcc, probably syntax
>
> The following code works
>
> Set objMail = Server.CreateObject( "CDONTS.NewMail" )
> objMail.To = "i...@xxxxxx; "&request.Form("email")
> objMail.From = "i...@xxxxxx"
> objMail.Subject = "From us!"
>
> It sends to "to " and the adress collected on the form
>
> Now I need to add a bcc. I tried
>
> Set objMail = Server.CreateObject( "CDONTS.NewMail" )
> objMail.To = "i...@xxxxxx; "&request.Form("email")
> objMail.Bcc = "m...@xxxxxx"
> objMail.From = "i...@xxxxxx"
> objMail.Subject = "From us!"
>
> It sends to "to " and 2 copies to the the adress collected on the form
> but none to the newly added bcc.
>
> Any help greatly appreciated.
>
> Garry Jones
> Sweden
This code works fine for me:

cdoBasic=1
schema = "http://schemas.microsoft.com/cdo/configuration/"
Set objEmail = CreateObject("CDO.Message")
With objEmail
.From = "james.company.com"
.To = "jack@xxxxxx"
.CC = "jill@xxxxxx"
.BCC = "john@xxxxxx"
.Subject = "Test Mail"
.Textbody = "The quick brown fox " & Chr(10) & "jumps over the lazy dog"
With .Configuration.Fields
.Item (schema & "sendusing") = 2
.Item (schema & "smtpserver") = "mail.company.com"
.Item (schema & "smtpserverport") = 25
.Item (schema & "smtpauthenticate") = cdoBasic
.Item (schema & "sendusername") = "smtp@xxxxxx"
.Item (schema & "smtpaccountname") = "smtp@xxxxxx"
.Item (schema & "sendpassword") = "smtp"
End With
.Configuration.Fields.Update
.Send
End With


My System SpecsSystem Spec
Old 08-30-2009   #3 (permalink)
GarryJones


 
 

Re: BCC Problem

That code you gave me looks very complicated. I know nothing of
vbscript but have inherited a website with the code I quoted. The
solution cited has inserted a lot of dots before every row which I did
not have in my original code. Maybe it can not be done with that code
format so maybe I need to translate the entire section of that part of
the website with the code format where dots are needed before rows.
Therefore I post the entire section in the hope someone can tell me
exactly how to add bcc to this.

objRS.Open SQL, objConn, 3,3

Set objMail = Server.CreateObject( "CDONTS.NewMail" )
objMail.To = "info at mywebsite; "&request.Form("email")
objMail.From = "info at mywebsite"
objMail.Subject = "Confirmation from me"

Set objRS2 = Server.CreateObject("ADODB.Recordset")

SQL = "select * from tableA where id ="&request.Form("field_id")

objRS2.Open SQL, objConn, 3,3

item1= objRs2("field1") &" fritext1 "&objRs2("field2") & "
freetext2"&objRs2("field3")

objMail.Body = "Hello "&request.Form("field1")&" ("&request.Form
("field10")&")" & vbcrlf & vbcrlf & "Welcome"

objMail.Host = "mailout dot isp dot com"
objMail.Send
Set objMail = Nothing

response.redirect("../samepage.asp?mess=It worked")
%>

How do I add BCC ???? Do I really need to rewrite the entire code and
puts dots in.

Any help appreciated because I am out of my depth.

Garry Jones
Sweden
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
the problem with ndis.sys Blue Screen of Death problem solved? Vista General
Re: Windows Mail Attachement Problem and Adobe Player Problem with IE8 Vista mail
Multi-select problem in Windows Explorer BIG PROBLEM!!!!!! Vista General
Generic McAfee Problem Message in Vista Problem Reports Vista performance & maintenance
Vista Upgrade Problem - Windows Explorer Loop problem Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46