Jump to content

using php to post to email


Guest fubar::chi
 Share

Recommended Posts

Guest fubar::chi

ooh. my first post in "Terminal Shell Commands, Kernel and Programming". I'm all tingly. On to the matter at hand. I'm trying to mail information to my e-mail address once i have users press the submit button on my site. How would i do that. Can I POST to an email address instead of a webpage. To do that do I have to have a mail server running

Link to comment
Share on other sites

That depends, where is the site hosted? do they have a form to email cgi availible?

My isp has one at "http://www.ihug.co.nz/cgi-bin/mailto" you use that as the action address eg.

 

<form action="http://www.ihug.co.nz/cgi-bin/mailto" method="post">

 <input name="followup-page" type="hidden" value="http://www.fubars.com/thanks.htm"><input name="recip" type="hidden" value="fubar@fubar.com"><input name="subj" type="hidden" value="Hey Fubar"><input name="from" size="30" value="type you email address here">

 Message

 <blockquote>

   <p><textarea cols="45" name="Comments" rows="10"></textarea></p>

 </blockquote>

 <p><input name="name" value="Enter your name here" size="20"> <input type="submit" value="click here to send Form"></p>

</form>

 

heres my isp's help section for form to mail gateways (your isp may use a different cgi though)

http://www.ihug.co.nz/support/homepages/ut...ies/mailto.html

Link to comment
Share on other sites

i'm hosting the site on my computer

 

Are you using php?

because if you are and you setup postfix on the server you can simply use php mail() functionhttp://nz2.php.net/mail

heh. i got mine in first :) thanks for the info

 

Me silly, as i got no sleep last night.

The title of your post clearly states that you are using php, argh! need more caffine :oops:

Link to comment
Share on other sites

Guest fubar::chi

mysql, ugh. gives me the willys just looking at that link. I'm staying as far away from that as human posiible for as long as i humanly can. why? "it just doesn't feel right."

got my mail working though. now everyone and there little sister can send me their favorite bible verses. since i'm usng sendmail i get it instantly :mystismiles:

Link to comment
Share on other sites

mysql, ugh. gives me the willys just looking at that link. I'm staying as far away from that as human posiible for as long as i humanly can. why? "it just doesn't feel right."  

got my mail working though. now everyone and there little sister can send me their favorite bible verses. since i'm usng sendmail i get it instantly :mystismiles:

 

Do you dislike mysql? or databases in general? if the former you can used postgres or firebird.

 

You could do something similar to the article but mail to a postfix/sendmail server or write it to a txt file using php. Using a database with php is no harder than writing to a txt file, although with the text file you avoid having another service on the machine.

Link to comment
Share on other sites

Guest fubar::chi

mysql. it used to be required for installing qt-devel and I always hated that i had to use the rpm command or uninstall because I wasn't using the damned thing. postgresl is the same

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...