|
-
Feb 20th, 2006, 08:25 AM
#1
Thread Starter
Fanatic Member
Mail() Not Working
I'm quite new to PHP.
I've just built my first PHP form handler that will save the form data to a text file on my server and then email me an alert, but the Mail() function isn't sending me the email.
I have set it to send to my gmail account but I don't receive it in my inbox or spam.
How can I make it email me properly?
-
Feb 20th, 2006, 12:33 PM
#2
Re: Mail() Not Working
 Originally Posted by shirazamod
I'm quite new to PHP.
I've just built my first PHP form handler that will save the form data to a text file on my server and then email me an alert, but the Mail() function isn't sending me the email.
I have set it to send to my gmail account but I don't receive it in my inbox or spam.
How can I make it email me properly?
Can you post the code you are using?
Cheers,
Ryan Jones
-
Feb 20th, 2006, 02:29 PM
#3
<?="Moderator"?>
Re: Mail() Not Working
What server software are you using IIS, Apache, other? It could be that your SMTP server ins't set up correctly.
-
Feb 21st, 2006, 07:48 AM
#4
Thread Starter
Fanatic Member
Re: Mail() Not Working
OK, I've found that the problem is with my hosting company not allowing me to send email to other email addresses (eg: Gmail)
Thanks for all the help,
Shiraz
-
Feb 21st, 2006, 08:43 AM
#5
Fanatic Member
Re: Mail() Not Working
Hi!
I am trying to configure PHPMailer on my site to be able to submit a form with an attachement by email. I am using SMTP, I get none error but I don't receive any email...
Code:
<?php
require("class.phpmailer.php");
$mail = new phpmailer();
$mail->From = "[email protected]";
$mail->FromName = "List manager";
$mail->Host = "localhost"; // I THINK I MIGHT BE HERE.....
$mail->Mailer = "smtp";
// HTML body
$body = "Hello <font size=\"4\">FULL_NAME</font>, <p>";
$body .= "<i>Your</i> personal photograph to this message.<p>";
$body .= "Sincerely, <br>";
$body .= "phpmailer List manager";
// Plain text body (for mail clients that cannot read HTML)
$text_body = "Hello FULL_NAME, \n\n";
$text_body .= "Your personal photograph to this message.\n\n";
$text_body .= "Sincerely, \n";
$text_body .= "phpmailer List manager";
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->AddAddress("[email protected]", "FULL_NAME"); // obviously, this is a dummy email only for this post...
//$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
if(!$mail->Send())
echo "There has been a mail error sending to " . $row["email"] . "<br>";
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
?>
-
Feb 21st, 2006, 02:10 PM
#6
<?="Moderator"?>
Re: Mail() Not Working
Have you setup your SMTP server to allow for PHP to relay message though it?
-
Feb 21st, 2006, 03:13 PM
#7
Fanatic Member
Re: Mail() Not Working
hmm... I didnt not do anything else than coding a php file and uploading it to the server...
So I guess I have to set it up? How can I do this??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|