|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
macrumors newbie
Join Date: Jan 2006
Location: North Dakota
|
Configure Mail in PHP
Anybody know how to congifure mail in
php so that it works? Running Panther and using localhost so I can mess with my configure files. Tried this code and nothing happens. Thanks for the help! <?php //Some variables $mymail = "jumpersknee@bis.midco.net"; $ename = $_POST['ename']; $eemail = $_POST['eemail']; $esubject = $_POST['esubject']; $emessage = $_POST['emessage']; $eip = $_POST['eip']; //Function to check email address function checkemail($eemail) { if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$eemail)) { return true; } else { return false; } } //Mail Processing if ($_POST['esubmit']) { //Check for blank fields if ($ename == "" || $eemail == "" || $esubject == "" || $emessage == "") { echo "<p>It appears that you left a blank field.<br/> Please make sure you fill everything in.</p>"; } //Check to see if the email address is valid else if (checkemail($eemail) == false) { echo "<p>It appears that you enter an invalid email address.<br/> Please check your email again.</p>"; } //Send the email if there's no error else { $body = "$emessage\n\nName: $ename\nEmail: $eemail\nIp: $eip"; mail($mymail,$esubject,$body,"From: $eemail\n"); echo "<p>Thank you for your email $ename!</p>"; } } ?> |
|
|
|
| jumpersknee |
| View Public Profile |
| Find More Posts by jumpersknee |
|
|
#2 | |
|
macrumors regular
Join Date: Jan 2002
Location: Bob Fossils Zooniverse
|
Quote:
The easiest way of doing this is via PostfixEnabler if you are using Panther or MailServe for Tiger. You can enable Postfix without spending any money but you'll have to do a reasonable amount of homework (macosxhints.com is a good starting place and Webmin is a free and fantastic tool that can help ). One thing to look out for is the fact that a lot of ISP's will block outgoing mail from your Mac as protection against Spam - so you may need to set up Postfix to use an existing email host. Hope this lot of waffle is of some use - I'm no expert!
__________________
Blue Pants, Blue Pants, I've got baby Blue Pants. The Mighty Boosh I Audioscrobble |
|
|
|
|
|
|
#3 |
|
Demi-God (Moderator)
Join Date: Mar 2004
Location: Bergen, Norway
|
Are you sure that the script actually gets all the way down to execute the mail() function?
Try making a very easy php script: Code:
<?php $mymail = "<your mail address>"; $esubject = "Test"; $body = "Body"; $eemail = "<your mail address>"; $sent = mail($mymail,$esubject,$body,"From: $eemail\n"); if ($sent) echo "Sent a mail to ".$mymail; else echo "Couldn't send mail...?"; ?>
__________________
Those who fail to learn history are doomed to repeat it;
those who fail to learn history correctly... why, they are simply doomed. |
|
|
|
| Mitthrawnuruodo |
| View Public Profile |
| Find More Posts by Mitthrawnuruodo |
|
|
#4 |
|
macrumors regular
Join Date: Jan 2002
Location: Bob Fossils Zooniverse
|
And one other thing -
Open up 'Console' (Applications->Utilities), and examine the /var/log/mail.log file. That can give a lot of clues.
__________________
Blue Pants, Blue Pants, I've got baby Blue Pants. The Mighty Boosh I Audioscrobble |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|