PDA

View Full Version : Mail to Friend with ASP


Planche
07-12-2007, 10:41 AM
Hi!

I'm working on a site that as a "send to friend" feature, and I was working with php and the thing was workinig just fine. But now the client told me the server as a windows based machine and no PHP only ASP, so I've got to make this thing work with ASP.

This is what I have in flash:

3 textfields with this variable names: mailto_txt, from_txt, subject_txt

A button with this code:

on (release) {
getURL("sendmail.asp", "_blank", "GET");
}

And then a ASP page with this:


<.asp>
<head>
<title>Certora</title>
<meta http-equiv="Content-Type" content="text.asp; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">

<%

Dim strFrom, strTo, strSubject, strBody

strFrom = Request.QueryString("from_txt")
strTo = Request.QueryString("mailto_txt")
strSubject = Request.QueryString("subject_txt")
strBody = Request.QueryString("mailMessage")

Dim MyMail
Set MyMail = Server.CreateObject("CDONTS.NewMail")

MyMail.From = strFro
MyMail.To = strTo
MyMail.Subject = strSubject
MyMail.BodyFormat = 1
MyMail.MailFormat = 0
MyMail.Importance = 2
MyMail.Body = strBody
MyMail.Send

Set MyMail = Nothing

%>

E-mail enviado com sucesso.
</body>
<.asp>


And I never this to work and no mail is sent.
Anyone can help?

Cota
07-12-2007, 06:56 PM
Make sure the server has CDONTS installed.

Planche
07-13-2007, 03:42 PM
That might be a problem beacuse it's hostend on a server that really doesn't let us move in any direction, really horrible.

I've made this solution with php, using our current server to process the e-mail, and solvede the problem, but I'm still looking for an ASP solution...