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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO not work - Urgent help needed

Status
Not open for further replies.

siena

Technical User
Jan 30, 2003
262
0
0
US
Hello all,
I have a cdo email component that my company has been using now for about 3 weeks.
Yesterday, they determined that we need to bold a portion of the information on the body of email.
For instance, if we have a message like this:
"Your order is" &order&, we would like to bold the "Your order is" part.
Unfortunately, I found out yesterday that cdo doesn't allow formatting.
I was wondering if anyone has a sample of sending html email that picks info from the database and sends them out.

Below is what the cdo part that I needed to format but couldn't.
With iMsg

Set .Configuration = iConf

.From = ""&AuthEmail&""
.To = "john.doe@yahoo.com ;" & ccCheck & " "
.Sender = ""&AuthEmail&""
.cc = ""&AuthEmail&""
.Subject = "User Request Form: "&key&""
.TextBody = "User Request Form " & vbCrLf & vbCrLf & "Request Form Number:" &key&" " & vbCrLf & vbCrLf & "Service Requested: "&service&", "&ccCheck&"."& vbCrLf & vbCrLf & "Profile: "&Profile&"." & vbCrLf & vbCrLf & "Authorized Requestor Name: "&authname&" & "Mother's Maiden Name: "&MotherMaidenName&". " & vbCrLf & vbCrLf & "Job Title: "&jobTitle&". Phone Number: "&phone&". Notary Initial: "&NotaryInitial&"." & vbCrLf & vbCrLf &"Address: "&StAddress&", Suite: "&SecAddress&" City: "&city&", Zip: "&Zip&". " & vbCrLf & vbCrLf & "Agency Name: "&AgencyName&". Agency Number: "&AgencyNo&". Organization Name: "&OrgName&". Organization Number: "&OrgNo&". Vendor: "&Company&". "& vbCrLf & vbCrLf & "User ID to be Modeled: "&UserID&". "& vbCrLf & vbCrLf & "VPS - Pagecenter Information: "& vbCrLf & vbCrLf & "Application: "&VSPapp&" Mailbox: "&VPSmailbox&" & vbCrLf & "Notes: "& vbCrLf & vbCrLf & ""&Notes&""


.Send

End With

Any urgent assistance would be greatly appreciated.

Thanks in advance
 
Instead of using .textbody change it to .HTMLbody and use HTML tags to do you formatting.

If you need an example let me know.

Cassidy
 
hi Cassidy!

Can you give me an example, please?
 
'Process email notification

Set m_objCDO = Server.Createobject("CDO.Message")
Set m_objCDOcon = Server.Createobject("CDO.Configuration")

Const cdoSendUsingMethod = "Const cdoSendUsingPort = 2
Const cdoSMTPServer = "Const cdoSMTPServerPort ="Const cdoSMTPConnectionTimeout = "Const cdoSMTPAuthenticate = "Const cdoBasic = 1
Const cdoSendUserName = "Const cdoSendPassword = "

'Sending email notification
set Fields = m_objCDOcon.Fields

'Setting up Message parameters
with Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
'Replace with your SMTP server
.Item(cdoSMTPServer) = "smtp.Server.com"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
'Only used if SMTP server requires Authentication
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "Username"
.Item(cdoSendPassword) = "Password"
.Update
end with

'Passing parameters to message object
Set m_objCDO.Configuration = m_objCDOcon

With m_objCDO
'Replace with email you wish the message to be sent to
.To = "email@youraddress.com"
'Replace with email you wish the message to be from
.From = "email@youraddress.com"
'Replace with subject
.Subject = "ASP Generated Email"
'Replace with information you want to be sent
.HTMLBody = "<B>This is text Bold</B><BR>This is text not Bold<BR>"
.Send
End With
 
It's working great,
Thanks a bunch!
I was told it could never be done with CDO; you are great!
 
Just keep in mind that you have to make sure your clients can all accept HTML body emails.

Let me know if you need anything else.

Cassidy
 
You have to correctly setup the SMTP server.
- relay
- connection
- SECURITY: add the ASPNET user to the operators list

Bogdan Bucura
CEO Widesoft SRL
Your software company
 
thanks for the post but Cassidy has helped me resolve this.
Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top