View Full Version : new to ASP, convert few lines from PHP to ASP, please.
jasonc310771
03-18-2008, 01:17 PM
I am completely new to ASP and have only done one script.... 'Hello World' !
But I do know a lot of PHP.
what i would be grateful of is if someone could either convert this code from PHP to ASP or better still direct me to a website that shows me all the commands like php.net does so i can learn myself.
thanks
<?
$from_private_sys_email = "noreply@noreply.com";
$email_headers = "Content-Type: text/html; charset=ISO-8859-1\r\nFrom: ".$from_private_sys_email."\r\n";
mail("me@me.com", "test subject", "test body", $email_headers);
?>
mjlorbet
03-18-2008, 01:49 PM
what you're looking to have converted in this example is actually a whole lot more complicated in asp... System.Net.Mail would be a good place to start finding out information on and the resource for that would be http://www.msdn.com. for the most part, the reason to go to asp instead of php is that you no longer need to re-invent the wheel every time you do something (same way it was with regular asp). asp.net brings to the table the component model where you can "drag&drop" server side controls right onto your page & they actually do something, if you're going with asp.net & not regular old asp 3.0 then maybe something like this would help you (pre-made) http://www.asp.net/community/control-gallery/Item.aspx?i=46
jasonc310771
03-18-2008, 02:17 PM
ok i am helping a mate out and he has not told my his server is ASP only, or it does not allow PHP file to run.
he has a form that is filled out and i suggested changing the way it is sent.
at present visitor fills out form and click 'submit' which opens an email ready to be sent.
what if they are in an internet cafe or a friends house and that pc does not have outlook or outlook express setup for 'their' email, this will mean the email is not sent.
so the form is filled out name address zip and phone details then this is sent to him in an email. more user friendly for the visitors i think.
is there an easier way to do all of the above, instead of my trying to do bit by bit and then finding out there is a better way to all of it.
thanks
mjlorbet
03-19-2008, 12:48 AM
two solutions, 1) either read up on system.net.mail so you can access the .net methods for sending mail via an asp application or get a pre-made server-control to do it for you 2) install the isapi filter for php so your php application can run on his server, there's not really a specific asp only server, as asp is just the manifestation of an isapi filter, meaning that his server has the capabilities for isapi filters which means he can serve php given the right filter being installed
dudeshouse
03-31-2008, 03:03 PM
How about using something as simple as the formmail script from www.brainjar.com (http://www.brainjar.com)? Send the email right from the form...
HTH
W3 Schools would be a good place to start :)
http://www.w3schools.com/asp/asp_send_email.asp
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.