Jump to content

[SOLVED] A simple email script...


Drags111

Recommended Posts

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!

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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? :P 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.