Jump to content

PHP to ASP


apamukcu

Recommended Posts

Hello everybody,I have been using PHP to do forms in flash, but in this project I had to use ASP because of the servers. So I am hopping there is a way to convert the PHP code to ASP with CDONTS. Here is my PHP code. Thanks in Advance.Adnan

<?PHP// read the variables form the string, (this is not needed with some servers).$theName = $_REQUEST["theName"];$theEmail = $_REQUEST["theEmail"];$theMessage = $_REQUEST["theMessage"];$to = "apamukcu@gmail.com";$subject = "VESTEL Sanat Galerisi Websitesi Formu";$message = "Name: " . $theName;$message .= "\nEmail: " . $theEmail;$message .= "\n\nMessage: " . $theMessage;$headers = "From: $theEmail";$headers .= "\nReply-To: $theEmail";$sentOk = mail($to, $subject, $message, $headers);echo "sentOk=" . $sentOk;?>

Link to comment
Share on other sites

HiYes, there is way of converting your PHP code to ASP code, I have just posted the following asp code for your reference, edit, try it, and respond if that went successful, do not forget to use an existing SMTP / mail Server:<%@ Language=VBScript %><%set Mailer = server.createobject("CDO.Message") Mailer.From = Request.Form(NameFrom) Mailer.To = Request.Form(NameTo) Mailer.Subject = Request.Form(Subject) Mailer.HTMLBody = Request.Form(MessageBody) with Mailer.Configuration .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "YourSmtpServername-Here" .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "25" .Fields.Update end with Mailer.Send set Mailer = Nothing%>

Hello everybody,I have been using PHP to do forms in flash, but in this project I had to use ASP because of the servers. So I am hopping there is a way to convert the PHP code to ASP with CDONTS. Here is my PHP code. Thanks in Advance.Adnan
<?PHP// read the variables form the string, (this is not needed with some servers).$theName = $_REQUEST["theName"];$theEmail = $_REQUEST["theEmail"];$theMessage = $_REQUEST["theMessage"];$to = "apamukcu@gmail.com";$subject = "VESTEL Sanat Galerisi Websitesi Formu";$message = "Name: " . $theName;$message .= "\nEmail: " . $theEmail;$message .= "\n\nMessage: " . $theMessage;$headers = "From: $theEmail";$headers .= "\nReply-To: $theEmail";$sentOk = mail($to, $subject, $message, $headers);echo "sentOk=" . $sentOk;?>

Link to comment
Share on other sites

Hello,Thanks for you help, I will try it tonight.I appreciate your help.Adnan

HiYes, there is way of converting your PHP code to ASP code, I have just posted the following asp code for your reference, edit, try it, and respond if that went successful, do not forget to use an existing SMTP / mail Server:<%@ Language=VBScript %><%set Mailer = server.createobject("CDO.Message") Mailer.From = Request.Form(NameFrom) Mailer.To = Request.Form(NameTo) Mailer.Subject = Request.Form(Subject) Mailer.HTMLBody = Request.Form(MessageBody) with Mailer.Configuration .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "YourSmtpServername-Here" .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "25" .Fields.Update end with Mailer.Send set Mailer = Nothing%>
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...