hyipcharts Posted April 14, 2007 Share Posted April 14, 2007 Hi all, I have finished my script and installed it on my site yesterday. http://www.hyipcharts.com It has three places where I receive email. None of them are working. I know the settings are all correct on the hosting side, it worked with the old script. If anyone could take a look at the code and see if there are any mistakes I am missing. I tried this and it sent an email. <? $status = mail('[email protected]', 'test', 'test'); if($status) echo "Mail sent successfully"; else echo "Error in Mail sending"; ?> My contact for code is: <?php $PageTitle='Contact'; require_once('config/config.php'); require_once('config/func.php'); $name=stripslashes(htmlspecialchars($_POST['name'])); $mail=$_POST['mail']; $msg=stripslashes(htmlspecialchars($_POST['msg'])); if ($_POST['go']==1) { if(!empty($mail) && !empty($name) && !empty($msg)) { if ($_SESSION['uniqCode']==$_POST['ui']) { session_unregister('uniqCode'); if(preg_match("/.+@.+\..+/", $mail)) { $message="Name: $name E-mail: $mail Message: $msg"; if(mail(AdminMail, 'Message from feedback form', $message, "FROM: ". PageTitle ."<>")) { mail($mail, 'Thanks for sending message', 'Thanks for sending message to the administrator of '. PageTitle, "FROM: ". PageTitle ."<>"); unset($name, $mail, $msg, $_POST['go']); $added=true; } else $error='Error occured when trying to send your message to administrator.'; } else $error='Incorrect e-mail address!'; } else $error='Thanks for sending message'; } else $error='Fill all fields!'; } require('config/begin.php'); ?> <table width="600" border="0" align="center"> <tr> <td> <h1>Contact</h1> </td> </tr> <tr> <td> <?php $t=explode(' ', microtime()); $uniqCode=uniqid($t[1]); session_register('uniqCode'); if(strlen($error)) error($error); elseif($added===true) echo('<div class="msg">Message was sent to administrator. Thank you.</div>'); ?> <form method="post" style="margin: 0px"> <input type="hidden" name="go" value="1"> <input type="hidden" name="ui" value="<?php echo $uniqCode ?>"> <table width="400" align="center" border="0"> <tr> <td width="60">Name:</td><td width="340"><input type="text" size="20" maxlength="20" name="name" value="<?php echo $name ?>"></td> </tr> <tr> <td>E-mail:</td><td><input type="text" size="20" maxlength="32" name="mail" value="<?php echo $mail ?>"></td> </tr> <tr> <td valign="top">Message:</td><td><textarea cols="40" rows="8" name="msg"><?php echo $msg ?></textarea></td> </tr> <tr> <td colspan="2" align="center"> <input type="reset" value=" RESET "> <input type="button" value=" SUBMIT " onClick="this.form.submit();this.disabled=true"> </td> </tr> </table> </form> </td> </tr> </table> <?php require('config/end.php'); ?> Where it calls for AdminMail, I have that set up in the db connect file: define('AdminMail', '[email protected]'); Any help would be appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/46987-email-issues/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.