Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 25th, 2007, 07:02 PM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default aspMail

 I am having trouble using aspMail in my asp site.

The main language of the site is JScript and I am trying to re-use some code for aspMail (VBScript) as I have run out of time to look and create a JScript equivalent (due Monday at midnight):

I have a connect.asp file which contains this code:

Code:
<%@ LANGUAGE="JAVASCRIPT" %>
<%
myconn=Server.CreateObject("ADODB.connection");
mydb = "Driver={Microsoft Access Driver (*.mdb)};DBQ=e:\\webareas\\mg511\\SHIC\\shic.mdb";

myconn.Open (mydb);
rs = Server.CreateObject("ADODB.Recordset");
%>
I have this code for the aspMail:
Code:
<%
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtp.gre.ac.uk"
Mail.FromName = request("nameBox")
Mail.From = request("emailBox")
Mail.AddAddress request ("emailhidden")
Mail.Subject = "Enquiry Confirmation"
Mail.IsHTML = True
Mail.Body = "<html><body><b>Name: </b> "& request ("nameBox") &"<br /><b>Requested Event: </b>"& request ("select") &" <br /><b> Email:</b> "& request ("emailBox") &" <br /><b> Telephone:</b> "& request ("telephoneBox") &"</body></html>"

Mail.Send

%>
The problem is that the server is expecting JScript code, can as such does not run the aspMail page correctly.

Heres a link to the problem: http://cms-stu-iis.gre.ac.uk/mg511/S...asp?memberid=4

Any help would be greatly appreciated

Thanks in advance
Graham


Reply With Quote
  #2 (permalink)  
Old February 26th, 2007, 02:14 AM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Have you thought about using CDOSYS? This is reccomended and the most problem free mail method

A working sample:

<!--
Sending SMTP mail via port 25 using CDOSYS This ASP page
uses CDOSYS to send SMTP mail using port 25 of the SMTP
server that is set. The e-mail delivery is handled by the
SMTP server that is set in the configuration object.
-->
<%
Const cdoSendUsingPort = 2
Dim iMsg,iConf,Flds,strHTML,strSmartHost
StrSmartHost = "your mail IP"
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
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
   .Update
End With

'apply the settings to the message
With iMsg
   Set .Configuration = iConf
   .To = "someEmailAddress"
   .From = "someOtherEmailAddress"
   .Subject = "someSubject"
   .HTMLBody = "Sent using CDOSYS..."
   .Send
End With

' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

%>

Wind is your friend
Matt
Reply With Quote
  #3 (permalink)  
Old February 26th, 2007, 06:24 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, i am assuming that this is in VBScript! Am I correct in that assumtion?

Reply With Quote
  #4 (permalink)  
Old February 26th, 2007, 06:51 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Yes indeed.

If you are using a Windows 2000 / 2003 Server, or even XP Pro chances are that CDOSYS is your best
bet for sending email from ASP. That is because CDOSYS is installed on all of them
by default. Gone are the days of using CDONTS which was the old way of sending email from ASP.
CDOSYS is it's replacement. NOTE: The CDONTS .dll is no longer shipped nor supported by MS


Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
aspMail Morn ASP.NET 2.0 Basics 1 February 25th, 2007 09:40 PM
ASPMail embaded images kalpitkk Classic ASP Professional 1 January 9th, 2006 01:06 PM
ASpMail chocobabe100 Classic ASP Basics 1 May 5th, 2005 11:27 PM
ASPMail / Shift_JIS jz552 Classic ASP Professional 0 May 4th, 2005 02:39 PM
AspMail mmarkym Classic ASP Components 2 December 21st, 2003 01:36 PM



All times are GMT -4. The time now is 10:58 AM.


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