Solved

CDO for text message from classic asp

Posted on 2011-03-14
3
382 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

803 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