Help with Mail() function

I need help with the Mail() function....

Page 1 of 1

4 Replies - 1850 Views - Last Post: 01 May 2006 - 01:45 PM Rate Topic: -----

#1 rooneydavid  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 01-May 06

Help with Mail() function

Post icon  Posted 01 May 2006 - 06:28 AM

Im having trouble with the Mail() function, I am using the following code that I found on this site:

<?php
$email_to = "somebody@email.com";
$email_subject = "Test E-Mail (This is the subject of the E-Mail)";
$email_body = "This is the body of the Email \nThis is a second line in the body!";

if(mail($email_to, $email_subject, $email_body)){
echo "The email($email_subject) was successfully sent.";
} else {
echo "The email($email_subject) was NOT sent.";
}
?>

The script is returning that the mail was sent but Im not getting the emails. I am a VB programmer and this has be puzzled. Does anyone know a diffrent way of sending emails in PHP???

Is This A Good Question/Topic? 0
  • +

Replies To: Help with Mail() function

#2 Nova Dragoon  Icon User is offline

  • The Innocent Shall Suffer, Big Time
  • member icon

Reputation: 36
  • View blog
  • Posts: 6,169
  • Joined: 16-August 01

Re: Help with Mail() function

Posted 01 May 2006 - 12:18 PM

Is your host properly set up to send mails generated by php?
Was This Post Helpful? 0
  • +
  • -

#3 rooneydavid  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 01-May 06

Re: Help with Mail() function

Posted 01 May 2006 - 12:41 PM

As far as I know its dedicated. But Im not 100% on that. Here is the information I do have:

Apache/1.3.33 Unix mod_auth_passthrough/1.8 mod_bwlimited/1.4 mod_log_bytes/1.2 mod_gzip/1.3.26.1a PHP/4.3.11 FrontPage/5.0.2.2634a mod_ssl/2.8.22 OpenSSL/0.9.7a

This is the information I got in the PHPINFO() to do with mail,
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i

Path to sendmail /usr/sbin/sendmail -t -i

If this is of any help???
Was This Post Helpful? 0
  • +
  • -

#4 Nova Dragoon  Icon User is offline

  • The Innocent Shall Suffer, Big Time
  • member icon

Reputation: 36
  • View blog
  • Posts: 6,169
  • Joined: 16-August 01

Re: Help with Mail() function

Posted 01 May 2006 - 12:46 PM

Are you setting

$email_to =

to a valid email address?
And is that address you are sending it to, doing any mail filtering such as spam filtering?
Was This Post Helpful? 0
  • +
  • -

#5 rooneydavid  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 01-May 06

Re: Help with Mail() function

Posted 01 May 2006 - 01:45 PM

Im sending it to my GMail account (with no filtering) and I am still not getting any emails from it. I've even looked in the Spam folder and there is nothing there. In VB there is a couple of ways to send emails, is this the same for PHP or is there only the Mail() function??

This post has been edited by rooneydavid: 01 May 2006 - 01:45 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1