Results 1 to 5 of 5

Thread: New to PHP. Need help with email script

  1. #1
    Join Date
    Oct 2005
    Location
    Palm Springs, CA.
    Posts
    21
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default New to PHP. Need help with email script

    Hello!
    I'm new to this forum and PHP. I'm trying to figure out the code needed for sending a form to a website's email address. I'm assuming I need PHP, as in the ftp directory is has a folder for PHP uploads. Can someone point me in the right direction?

    Many thanks,
    RockinRick

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    to send an email you need to have a php capable host, than u create your form and use the mail() function to actually send the email.

    PHP Code:
    $to "email @ domain.extension";
    $subject "whatever you want the subject of the email";
    $message "contents of the message (gather from your form)";

    mail($to$subject$message); 
    I would however suggest that you use some sanitizing techniques, like trim() (deletes before/after extra spaces) and strip_tags() (deletes and code tags)
    there are numerous tutorials on how to make your form as generic as possible, use google to search for those, there also might be a thread here, but if you have any specific questions about how to do something there are plenty of people here that would be willing to help

  3. #3
    Join Date
    Oct 2005
    Location
    Palm Springs, CA.
    Posts
    21
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thanks Boogyman for the reply!
    Yes the site I'm working on does handle PHP email. I've Googled beginner PHP and I'm just a little overwhelmed! I'm trying to recreate the form on this page: http://www.eastbayvet.com/site/view/...id=chb9crta95i

    It's for people refilling their pets medication online. I know I need a PHP Hypertext Document, but I'm still lost. Any further direction would be appreceated!

    Thanks again,
    RockinRick

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    what are you talking about hypertext?

    are you talking about the stuff that the user sees?
    or are you talking about the processing and sending of the information?

    if you are talking about the first, that is something you need to create yourself, the latter is most likely in the tutorials you obtained

  5. #5
    Join Date
    Oct 2005
    Location
    Palm Springs, CA.
    Posts
    21
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Sorry if I'm confused with terminology. A few years ago I installed a flash php email form and had bto use a mail script. I guess that's not the case here.

    I'm just trying to find out what I need to set up a form that can be emailed to the Vet.

    Thanks again,
    Rick

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •