Drags111 Posted April 26, 2009 Share Posted April 26, 2009 Hello, I'm new to php, and I need help with a simple php script. What i need to do is to send emails through my pascal project. I decided i should make a php script and put it on my server then just access that. Heres what i got in the script so far: <?php if (mail($_GET["to"], $_GET["subject"], $_GET["body"])) { echo("<p>Report successfully sent!</p>"); } else { echo("<p>Report delivery failed...</p>"); } ?> I use the URL like this: mysite.com/mail.php?to=myemail@gmail.com&subject=test&body=hello My problem is that i cant send multi lined emails, which is what i need to do really. Thanks so much for your help! Quote Link to comment Share on other sites More sharing options...
gevans Posted April 26, 2009 Share Posted April 26, 2009 First of all, this will allow anyone to use that email script and easily take advantgae of it and start spamming etc... Next you'd be better of writting a HTML form to submit the data, rather than writting the url out yourself. Also writting a bit more php to check what's being sent in the GET array as well as formatting the email a bit. There are lots of tutorials around for simple email scripts, you just beed ti check google Quote Link to comment Share on other sites More sharing options...
Drags111 Posted April 26, 2009 Author Share Posted April 26, 2009 Well i cant get on a webbrowser to type in the info. I'm trying to use it from a program that I'm making. And they can't spam my email if they dont know my email? If you're interested im using this in my program: procedure EmailReport; begin GetPage('that link i showed u'); end; Kind of like that. So its not like im using the webbrowser myself. Quote Link to comment Share on other sites More sharing options...
nankoweap Posted April 26, 2009 Share Posted April 26, 2009 My problem is that i cant send multi lined emails, which is what i need to do really. well, that's not entirely true. you can introduce newlines into the body by encoding them as %0A in the url. that's a zero and not an O. of course, i'd recommend heeding gevans' words, but if all you're trying to do is get through your pascal project, then giddyup. jason p.s. pascal, eh? that brings back some memories. Quote Link to comment Share on other sites More sharing options...
Drags111 Posted April 26, 2009 Author Share Posted April 26, 2009 haha ya Honestly i love coding in java much more, but im just making a simple bot for something Quote Link to comment Share on other sites More sharing options...
Drags111 Posted April 26, 2009 Author Share Posted April 26, 2009 oh and thanks a lot for the %0A! Solved my problem! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.