Jump to content

PHP to ASP


apamukcu
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...