Solved

CDO for text message from classic asp

Posted on 2011-03-14
3
378 Views
Last Modified: 2012-06-27
I am getting a "SendUsing" error message on this.  I am trying to send a text message from a classic asp page.  Any help?  Is a different port used for sending text messages?

	Set cdoConfig = CreateObject("CDO.Configuration")
	With cdoConfig.Fields
		.Item(cdoSendUsingMethod) = cdoSendUsingPort
		.Item(cdoSMTPServer) = "mail.bhi.com"
		.Item(cdoSMTPAuthenticate) = 1
		.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
		.Item(cdoSendUsername) = "UserName"
		.Item(cdoSendPassword) = "Password"
		.Update
	End With
	
	Set cdoMessage = Server.CreateObject("CDO.Message")
	With cdoMessage
		.From = sMyNumber
		.To = sTheirNumber & GetSendURL(TheirlProvider)
		.TextBody = sMsg
		.Send
	End With
	Set cdoMessage = Nothing

Open in new window

0
Comment
Question by:Bob Schneider
3 Comments
 
LVL 15

Accepted Solution

by:
pateljitu earned 350 total points
ID: 35132313
In your code you would need to set CONFIG settings for object CDO.MESSAGE

Set cdoMessage = Server.CreateObject("CDO.Message")
      With cdoMessage

                Set .Configuration = cdoConfig

            .From = sMyNumber
            .To = sTheirNumber & GetSendURL(TheirlProvider)
            .TextBody = sMsg
            .Send
      End With


0
 
LVL 11

Assisted Solution

by:G_H
G_H earned 150 total points
ID: 35133240
Try this:
Set objEMail = Server.CreateObject("CDO.Message")
	objEMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")             = 2
	objEMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")            = "mail.bhi.com"
	objEMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")        = 25
	objEMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
	objEMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")      = 1
	objEMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")          = "UserName"
	objEMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")          = "Password"
	objEMail.Configuration.Fields.Update
	
	objEMail.From = sMyNumber
	objEMail.Subject = eSubject
	objEMail.HTMLBody = CStr("" & sMsg)
	objEMail.TextBody = CStr("" & sMsg)
	objEMail.To = sTheirNumber & GetSendURL(TheirlProvider)
	objEMail.Send
	next
Set objEMail = nothing

Open in new window

GH
0
 

Author Closing Comment

by:Bob Schneider
ID: 35134568
Exactly what I needed!  Thank you....
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now