Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 20th, 2005, 12:03 AM
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Question about CDO

Hi, everyone.

I'm absolutely new to ASP. I have tried example in chapter 23 in Professionall ASP 3.0.

On the first line of the code from "SendMail.asp", it has following code.




Whenever I tried to run the example, I got an error on this line.

So I have searched the file on my computer, I don't have any file named "CDO.dll". I only have "crdb_cdo.dll".

Does that mean I didn't install something?

Can anyone tell me what I'm missing?

Thanks.

 
Old April 21st, 2005, 08:06 AM
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your operativ system must be Win 2000 /server or better
it dosent work with XP home or PRO.

 
Old April 21st, 2005, 12:13 PM
Authorized User
 
Join Date: Jun 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Another Question:
I am curious what is going on in the "myMail.Configuration.Fields.Item' lines the the below code. Specifcally why do you need this address "http://schemas.microsoft.com/"? Couldn't this be done with an include file or something. Is this actually going and getting the informaiton from microsoft. Sorry if this is a real dumb question.

Dale


<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="[email protected]"
myMail.To="[email protected]"
myMail.TextBody="This is a message."

myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2

'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.server.com"

'Server port
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25

myMail.Configuration.Fields.Update
myMail.Send
%>
 
Old May 23rd, 2005, 05:53 AM
Registered User
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi guys, I am new to asp, and have been stuck in the middle of someone else's code trying to depict a problem. The below code is part o a script with sends an email contain, senders name & email , subject and request.
The interface used is a simple web form of textboxes and a text area.

The reciever([email protected])gets about 40 blank emails a day due to some error which I can't depict from the code!

Can anyone guide me in the right direction to fixing this problem?
Many Thanks- stephenmarron

<%

' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

strSubject = Request.form("user_subject")
strName = Request.form("user_name")
strEmail = Request.form("user_email")
strMsg = Request.form("user_text")

Const cdoSendUsingPort = 2

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' Set the CDOSYS configuration fields to use port 25 on the SMTP server.

With Flds
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
    'ToDo: Enter name or IP address of remote SMTP server.
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "staffmail.xxxxxx.com"
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
    .Update
End With

' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> From :" & strName & " </b></br>"
strHTML = strHTML & "<b> Reply to : <a href='mailto:" & strEmail & "'>" & strEmail & " </a></b></br>"
strHTML = strHTML & "<b> Message : </b></br> " & strMsg & "</br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

' Apply the settings to the message.
With iMsg
    Set .Configuration = iConf
    .To = "info\@xxxxx.com" 'ToDo: Enter a valid email address.
    .From = "Contactus-WebForm\@xxxxx.com" 'ToDo: Enter a valid email address.
    .Subject = strSubject
    .HTMLBody = strHTML
    .Send
End With

' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

%>

 
Old May 25th, 2005, 12:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

I am not sure if you have posted the relevant data that would help us understand what goes wrong. As such the code looks fine. But can't really simulate the problem that you are facing or unable to imagine a cause for the same.

May be more details or something of that sort would help us understand what really goes wrong.

_________________________
- Vijay G
Strive for Perfection
 
Old May 25th, 2005, 10:50 AM
Registered User
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It seems that evertime the page with the form is opened/refreshed a msg is sent to the reciever,
I have been told to use a flag variable to stop this,
I am researching flag variables at the moment, If anyone can explain it to me in english, that would be brillo,
regards
steve

 
Old May 30th, 2005, 04:12 AM
Authorized User
 
Join Date: Aug 2003
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sherief Send a message via Yahoo to sherief
Default

hi steve,

this might help you,
Example: sendmail.asp
<%
intProcess = cint(request.form("hd_process"))

if intProcess = 1
'Place your send email code here
intProcess = 0
end if
%>
<form name="FormSend" action="sendmail.asp" method="post">
<input type="hidden" name="hd_process" value="1">
<input type="text" name="user_name" value="Name">
<input type="text" name="user_email" value="Email">
<input type="text" name="user_subject" value="Subject">
<textarea name="user_text"></textarea>
<input type="submit">
</form>

-----
Regards,
Sherief C. Mursyidi
http://www.sherief.net - Portal of IT pros
 
Old May 31st, 2005, 10:19 AM
Registered User
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Sherief,

I have realized the problem! I feel so stupid,
The problem was that the code to send and email was on the same page as the button to exe. the script,
Whenever the pages was loaded an message would be sent, hence the message being blank!
I just simply cut the code out of that page !!!

Thank you for all your help guys,
No doubt I'll have more queries because im a crap programmer, LOL
Later guys!
Stevo






Similar Threads
Thread Thread Starter Forum Replies Last Post
CDO - MAPI - Email - AddressBook Access Question HyperVirus Pro Visual Basic 2005 0 November 1st, 2007 05:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.