jtp101
asked on
ASPmail server component woes
Hi,
I'm trying to set up a secure ordering system for my site, using the ASPmail server component to send the orders encrypted using PGP.
I have never used ASPmail before and am having a few problems getting it to work properly.
I can use it to send simple email, no problem. However, when I try to extract the body text from a file, I simply get a blank email. No errors are produced, the email is sent without any problems. It's just blank.
The code I'm using is below.
Once I have sorted out the GetBodyTextFromFile problem, I'm probably going to need help getting the PHP bit to work...
Does anyone have any ideas?
Justin
-------------------------- ---------- ---------- ------
<%@ LANGUAGE = JScript %>
<html>
<head><title>ASP Mapppppiler Test</title><head>
<body>
<H3>ASP Mailer Test</H3>
<%
var Mailer = Server.CreateObject("SMTPs vg.Mailer" );
Mailer.FromName = "test FromName";
Mailer.FromAddress = "justin@petszaft.co.uk";
Mailer.RemoteHost = "mail.petszaft.co.uk";
Mailer.AddRecipient("Justi n", "justin@jtp.dircon.co.uk") ;
Mailer.Subject = "test Subject";
// Mailer.BodyText = "test BodyText";
// Mailer.PGPPath = "pgp.exe";
// Mailer.PGPParams = "+batchmode -a -e -t D:\websites\petsza\www\PHP test.txt mstrmalt@masterofmalt.co.u k";
if (Mailer.GetBodyTextFromFil e("PHPtest .txt", false, false)) {
if (Mailer.SendMail()) {
Response.Write("<p>Mail sent...");
Response.Write("\nMailer.R esponse: " + Mailer.Response);
}
else {
Response.Write("<p>Mail failure. Check mail host server name and tcp/ip connection...");
Response.Write("\nMailer.R esponse: " + Mailer.Response);
}
}
else {
Response.Write("<h2 align=center>Error: Failure with encryption or with file access...</h2>");
Response.Write("\nMailer.R esponse: " + Mailer.Response);
}
Response.Write("<br>Mailer .Response2 : " + Mailer.Response);
%>
</body>
</html>
I'm trying to set up a secure ordering system for my site, using the ASPmail server component to send the orders encrypted using PGP.
I have never used ASPmail before and am having a few problems getting it to work properly.
I can use it to send simple email, no problem. However, when I try to extract the body text from a file, I simply get a blank email. No errors are produced, the email is sent without any problems. It's just blank.
The code I'm using is below.
Once I have sorted out the GetBodyTextFromFile problem, I'm probably going to need help getting the PHP bit to work...
Does anyone have any ideas?
Justin
--------------------------
<%@ LANGUAGE = JScript %>
<html>
<head><title>ASP Mapppppiler Test</title><head>
<body>
<H3>ASP Mailer Test</H3>
<%
var Mailer = Server.CreateObject("SMTPs
Mailer.FromName = "test FromName";
Mailer.FromAddress = "justin@petszaft.co.uk";
Mailer.RemoteHost = "mail.petszaft.co.uk";
Mailer.AddRecipient("Justi
Mailer.Subject = "test Subject";
// Mailer.BodyText = "test BodyText";
// Mailer.PGPPath = "pgp.exe";
// Mailer.PGPParams = "+batchmode -a -e -t D:\websites\petsza\www\PHP
if (Mailer.GetBodyTextFromFil
if (Mailer.SendMail()) {
Response.Write("<p>Mail sent...");
Response.Write("\nMailer.R
}
else {
Response.Write("<p>Mail failure. Check mail host server name and tcp/ip connection...");
Response.Write("\nMailer.R
}
}
else {
Response.Write("<h2 align=center>Error: Failure with encryption or with file access...</h2>");
Response.Write("\nMailer.R
}
Response.Write("<br>Mailer
%>
</body>
</html>
Assuming that Server.MapPath is also available in JScript...
regards,
CJ
regards,
CJ
ASKER
Tried your suggestion, but it had no effect.
Any other ideas?
Any other ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I get the following output:
-------------------------- ---------- ---------- ----
ASP Mailer Test
Mail sent...
Mailer.Response:
Microsoft JScript runtime error '800a01b6'
Object doesn't support this property or method
/pgpmail3.asp, line 36
-------------------------- ---------- ---------- ----
do you know where I can find documentation on the ASPmail object model?
--------------------------
ASP Mailer Test
Mail sent...
Mailer.Response:
Microsoft JScript runtime error '800a01b6'
Object doesn't support this property or method
/pgpmail3.asp, line 36
--------------------------
do you know where I can find documentation on the ASPmail object model?
ASKER
Hi again CJ,
I have made a bit of a cockup, I managed to get the name of the file wrong!
It should have been PGPtest.txt rather than PHPtest.txt.
Sorry.
I am now having problems getting PGP to a file to encrypt a text file that I can load up as body text.
The encryption key I'm using has been registered with PGP on the server.
The code I'm using is below:
What am I doing wrong?
Justin
-------------------------- ---------- ---------- ----
<%@ LANGUAGE = JScript %>
<html>
<head><title>ASPMail Test</title><head>
<body>
<H3>ASP Mailer Test3</H3>
<%
var Mailer = Server.CreateObject("SMTPs vg.Mailer" );
Mailer.FromName = "test FromName";
Mailer.FromAddress = "justin@petszaft.co.uk";
Mailer.RemoteHost = "mail.petszaft.co.uk";
Mailer.AddRecipient("Justi n", "justin@jtp.dircon.co.uk") ;
Mailer.Subject = "test Subject";
Mailer.BodyText = "--- TEST3 ---";
Mailer.PGPPath = "c:\pgp\pgp.exe";
Mailer.PGPParams = "+batchmode -a -e -t " + Server.MapPath("PGPtest.tx t.asc") + " secureordersfromsite@maste rofmalt.co m";
Mailer.GetBodyTextFromFile (Server.Ma pPath("PGP test.txt") , false, false);
Mailer.SendMail();
%>
</body>
</html>
I have made a bit of a cockup, I managed to get the name of the file wrong!
It should have been PGPtest.txt rather than PHPtest.txt.
Sorry.
I am now having problems getting PGP to a file to encrypt a text file that I can load up as body text.
The encryption key I'm using has been registered with PGP on the server.
The code I'm using is below:
What am I doing wrong?
Justin
--------------------------
<%@ LANGUAGE = JScript %>
<html>
<head><title>ASPMail Test</title><head>
<body>
<H3>ASP Mailer Test3</H3>
<%
var Mailer = Server.CreateObject("SMTPs
Mailer.FromName = "test FromName";
Mailer.FromAddress = "justin@petszaft.co.uk";
Mailer.RemoteHost = "mail.petszaft.co.uk";
Mailer.AddRecipient("Justi
Mailer.Subject = "test Subject";
Mailer.BodyText = "--- TEST3 ---";
Mailer.PGPPath = "c:\pgp\pgp.exe";
Mailer.PGPParams = "+batchmode -a -e -t " + Server.MapPath("PGPtest.tx
Mailer.GetBodyTextFromFile
Mailer.SendMail();
%>
</body>
</html>
ASKER
I have solved my problem by using a combination of the ASPMail to send the mail and NSDPGP to do the encrypting.
I would still be happy to award the points for this question to anyone who knows why the code using just ASPMail didn't work, or can show a working example of sending encrypted email using just ASPMail.
Justin
I would still be happy to award the points for this question to anyone who knows why the code using just ASPMail didn't work, or can show a working example of sending encrypted email using just ASPMail.
Justin
ASKER
I have solved my problem by using a combination of the ASPMail to send the mail and NSDPGP to do the encrypting.
I would still be happy to award the points for this question to anyone who knows why the code using just ASPMail didn't work, or can show a working example of sending encrypted email using just ASPMail.
Justin
I would still be happy to award the points for this question to anyone who knows why the code using just ASPMail didn't work, or can show a working example of sending encrypted email using just ASPMail.
Justin
ASKER
I have solved my problem by using a combination of the ASPMail to send the mail and NSDPGP to do the encrypting.
I would still be happy to award the points for this question to anyone who knows why the code using just ASPMail didn't work, or can show a working example of sending encrypted email using just ASPMail.
Justin
I would still be happy to award the points for this question to anyone who knows why the code using just ASPMail didn't work, or can show a working example of sending encrypted email using just ASPMail.
Justin
hey jtp101 how did u work out the crypting thing with nsdpgp?? and what is nsdpgp.
I am working on aspmail and pgp but cant get it to work eighter. can u help me out?
I am working on aspmail and pgp but cant get it to work eighter. can u help me out?
ASKER
Hi Micropage,
Sorry to take so long to reply. You have probably solved your problem by now, but if you haven't then let me know and I will explain my solution.
Cheers,
Justin
Sorry to take so long to reply. You have probably solved your problem by now, but if you haven't then let me know and I will explain my solution.
Cheers,
Justin
no I had to give it up, but i would like to know how you did, and what you did.
if (Mailer.GetBodyTextFromFil