php mail problems on new server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
deras
Forum Newbie
Posts: 24
Joined: Sun Nov 02, 2003 10:26 am

php mail problems on new server

Post by deras »

i have a php mail script (shown below) which works fine on my old server but does not work on my new server. it seems to work (no errors, says mail sent), but i never get the emails (when i test it). so i am wondering if my php install is missing something. any ideas?

Code: Select all

<p></p> 
    <div align="center"> 
<?php 
if($submit){ 
$to="nnnn@nnnnn.com"; 
$from="From:$from"; 
$message ="comment"; 

mail($to,$subject,$message,$from); 
echo "Mail sent to $to<br>"; 
                 

echo "<br><br><br><br>"; 

exit; 
        } 

?> 
     
        <form action=email2.php method=post> 
        <table cellspacing=2 cellpadding=4 width="60%"> 
            <tr> 
                <td class=field>Subject:</td> 
                <td class=value><input type=text name=subject value="site suggestions/comments" size=60></td> 
            </tr> 
            <tr> 
                <td class=field>From:</td> 
                <td class=value><input type=text name=from value="<?php echo $session[email];?>" size=60><?php echo $useremail;?></td> 
            </tr> 
            <tr> 
                <td class=field>To: SimilarMinds</td> 
                <td class=value> 
                     
                </td> 
            </tr> 
             
            <tr> 
                <td class=field>Message<br> 
                    Text:</td> 
<td class=value><textarea name=message rows=4 cols=55> 
</textarea> 
                </td> 
            </tr> 
        </table> 
        <p><input type="submit" name="submit" value="Send"></p> 
    </form> 
    </div>
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

you check junk mail ?
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

Code: Select all

if (mail($to,$subject,$message,$from)) {
    echo 'mailed';
} else {
    echo 'not mailed';
}
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

do not disable bbCode if you post code
Post Reply