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='[email protected],[email protected],[email protected]';
        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='[email protected],[email protected],[email protected]';
        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='[email protected],[email protected],[email protected]';
        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
https://forums.phpfreaks.com/topic/23862-mail-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.