Jump to content

mail() function


jrodd32

Recommended Posts

I am trying to send mail automatically within my form.  I have read the php manual and it says that it will display errors if there is a problem with the function.  However, I am getting no errors and no emails.


[code]
<?php
while($row = mysql_fetch_assoc($officialslist))
  {
  if(($ID==$row[id])&&($SSWEB==$row[SSWEB]))
  {
    if(($sport == 'BA')||($sport == 'FB')||($sport == 'TR')||($sport == 'WR'))
      {
        $to='user1@webmail.khsaa.org,user2@webmail.khsaa.org,user3@webmail.khsaa.org';
        foreach($source as $concern)
          $subject=$concern;
        $message="<br>
$explaination
        <br>
        $row[id];
        <br>
        $row[lname].$row[suffix].', '.$row[fname];
        <br>
        $row[homephone];
        <br>
        $row[workphone];
        <br>
        $row[email]";
        $headers='X-Mailer: PHP/' .phpversion();
        mail($to, $subject, $message, $headers);
      }
    if(($sport == 'BK')||($sport == 'VB'))
      {
        $to='user1@webmail.khsaa.org,user2@webmail.khsaa.org,user3@webmail.khsaa.org';
        foreach($source as $concern)
          $subject=$concern;
        $message="<br>
$explaination
        <br>
        $row[id];
        <br>
        $row[lname].$row[suffix].', '.$row[fname];
        <br>
        $row[homephone];
        <br>
        $row[workphone];
        <br>
        $row[email]";
        $headers='From: $row[email]' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
        mail($to, $subject, $message, $headers);
      }
    if(($sport == 'SO')||($sport == 'SW')||($sport == 'SP')||($sport == 'FP'))
      {
        $to='user1@webmail.khsaa.org,user2@webmail.khsaa.org,user3@webmail.khsaa.org';
        foreach($source as $concern)
          $subject=$concern;
        $message="<br>
$explaination
        <br>
        $row[id];
        <br>
        $row[lname].$row[suffix].', '.$row[fname];
        <br>
        $row[homephone];
        <br>
        $row[workphone];
        <br>
        $row[email]";
        $headers='X-Mailer: PHP/' .phpversion();
        mail($to, $subject, $message, $headers);
      }
    }
  else
  $row=mysql_fetch_assoc($officialslist);
  }
?>
[/code]
Link to comment
Share on other sites

Are you running on a windows or linux machine...

the mail() function calls an external function (based on the settings in php.ini). You still need to have the external program installed (such as sendmail, etc).

see [url=http://www.php.net/mail]http://www.php.net/mail[/url]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.