php mail

php mail won't send

Page 1 of 1

3 Replies - 2047 Views - Last Post: 26 August 2008 - 10:04 AM Rate Topic: -----

#1 tightweb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-August 08

php mail

Posted 25 August 2008 - 09:27 PM

I'm not sure it's a code thing. Up until a few days ago our php scripts were working in sending out mail from a number of different php scripts. Here's a sample of what we use:

mail($to5, $subject5, $body5,"From: $from5 \nContent-Type: text/html; charset=i so-8859-1 \n");

Some one tried to upload a new script --- and then our scripts no longer worked.

We've checked both the sendmail configuration and the php .ini files to see if the install on the new program could have change them --- and the time and date stamps indicate that no changes where made.

Does anyone have an idea of what happended?

Is This A Good Question/Topic? 0
  • +

Replies To: php mail

#2 Martyr2  Icon User is online

  • Programming Theoretician
  • member icon

Reputation: 4424
  • View blog
  • Posts: 12,293
  • Joined: 18-April 07

Re: php mail

Posted 25 August 2008 - 09:40 PM

Are you saying you upgraded PHP and then the scripts didn't work? Please clarify as to what you mean "Some one tried to upload a new script".

So show us an example of the values you have in your variables. Also are you sending mail to Gmail? Rumor has it that you need to end the headers with two '\n' not just one.

More information on the situation would be nice. Thanks for helping us help you. :)
Was This Post Helpful? 0
  • +
  • -

#3 tightweb  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 25-August 08

Re: php mail

Posted 26 August 2008 - 08:53 AM

I'm sorry I didn't supply enough info.

This issue is located on a virtual web server running fedora 5 linux. We had attempted to install a new program we found on freshmeat.net into a test directory on that server (obviously we'll never do that again). We have not reinstalled either php or sendmail. Although the program we had attemtpted to install did not install properly, after attempting to install it, none of the php scripts on any of the virtual domains on the server which used php mail scripts would run ---- even though they all ran perfectly before.

We checked the sendmail.cf and php.ini to see if there were any modifications --- and we found that the date and time stamps were unchanged. Outside of the php scripts, sendmail works fine.
I should also add that we have our sendmail server on a different box - we only use sendmail and dovecot on this box to service the php scripts.

Also during this time, another admin was working on security issues on the machine, but according to his log, nothing that he did should have interferred with php.If anyone could suggest any possibly secure measure that was taken which could account for this, that would also be appreciated. In most cases, our staff looks for code on one server and matches it against another which runs the same version of linux redhat. Currently we are moving to fedora 8 and 9 so we do have some issues here as well.

Here is the message variable which was to be sent in the script. It is a simply a communication script that takes a communication from a visitor and sends it on to staff members. All of the pages are written in php (php Version 5.0.4). The variables were sent via an array from another page. In some cases, variables were also built from a mysql database table based upon variables received. To view to first page which sends out the array you can go to http://tightweb.net/...act_process.php. The full html code for the first page is:

<form action="contact_process.php" method="post">
<tr><td width="154" align="right"><div class="normal">Your Name:<font color="#FF0000">*</font></div></td><td width="486"><input type="text" name="name" value="" size="30" /></td></tr>
<tr><td width="154" align="right"><div class="normal">Your Email:<font color="#FF0000">*</font></div></td><td><input type="text" name="email" value="" size="30" /></td></tr>
<tr><td width="154" align="right"><div class="normal">Subject:<font color="#FF0000">*</font></div></td><td><input type="text" name="subject" value="" size="30" /></td></tr>
<tr><td width="154" height="176" align="right" valign="top"><div class="normal">
<br><br><br>Message:<font color="#FF0000">*</font>
</div></td><td><div class="normal"><font size="-2"><b>You can use <a href="http://velcom.com/support/tickettags.php" target="_blank">message tags</a></b></font></div><img src="blank.gif" width="1" height="5" /><br><textarea name="message" rows="8" cols="65"></textarea></b></td></tr>
<tr><td colspan="2" height="5"></td></tr>
<tr><td width="154" align="right"><div class="normal">Priority:<font color="#FF0000">*</font></div></td>
<td width="2">
<tr><td></td><td><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value=" Submit Communication " />&nbsp;<input type="Reset" /></td></tr>
</form>

The Message variable is:

$message_two = "<table width='95%' align='center'><font face='arial' size='2'><br><br>$date2<br>Dear $name<br><br>Thank you for your communication. Your comments, thoughts, suggestions and concerns are important to us. Should an answer be required, we will provide it within 48 hours.<br><br>Sincerely,<br>Tightweb Communications Support</td></tr></table>";

Here are the mail variables:

$to = $email;
$from = "support@tightweb.net";

Here is the mail code:

mail($to, $subject, $message_two,"FROM: $from \nContent-Type: text/html; charset=i so-8859-1 \n");

Hope I'm doing this right!!
Thanks for any help anyone can give.
Was This Post Helpful? 0
  • +
  • -

#4 Xarver  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 60
  • Joined: 06-August 08

Re: php mail

Posted 26 August 2008 - 10:04 AM

:code:

~ Xarver :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1