Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Unable to send mail Reply To: Unable to send mail

#146397
iamRDM
Participant

@traq I’m hosted with godaddy and the script is using geekmail.php for sending emails.
and this is the page which has the email feature.

<?
$res=mysql_query(“select * from invoices where id='”.$_SESSION[‘invoice’].”‘”)or die(mysql_error());
$info=mysql_fetch_array($res);
if(isset($_POST[‘sendinvoice’])){
$to=$_POST[‘to’];
if($to==”){
echo “

Please enter a valid Email

“;
}else{
$subject=$_POST[‘subject’];
$message=$_POST[‘message’];
$_GET[‘id’]=$_SESSION[‘invoice’];
include “inc/invoice_save.php”;

        $invoiceloc=str_replace(array('inc','mobile/'),'',dirname(__FILE__))."inc/invoices/".$_SESSION['invoice'].".pdf";
        if(mailer($to,$subject,$message,$invoiceloc)){
            echo "<div>Email has been Sent</div>";
        }else{
            echo "<div>Oops! Something went wrong!</div>";
        }
    }   

}

?>

<table align=’center’ style=’margin-top:40px; margin-bottom:40px;’>
<tr>
<td class=’alldone’ onclick=”window.open(‘inc/invoicepdf.php?id=<?=encrypt($_SESSION[‘invoice’].”-“.md5($_SESSION[‘invoice’]))?>’)”><br>Download PDF</td>
<td class=’alldone’ onclick=”window.open(‘inc/invoicehtml.php?id=<?=encrypt($_SESSION[‘invoice’].”-“.md5($_SESSION[‘invoice’]))?>’)”><br>View HTML</td>
</tr>
<tr>
<td class=’alldone’ colspan=’2′ onclick=”$(‘#emailtoclient’).slideDown(); $(‘html, body’).animate({scrollTop: 300}, 1000);”><br>Send as Attachment via Email</td>
</tr>
</table>

<form action=” method=’post’>
<table width=’310′ style=’background:#fff; display:none;’ align=’center’ id=’emailtoclient’>
<tr>
<td>Subject:</td>
<td><input type=’text’ class=’settings’ style=’width:235px;’ name=’subject’ value=’Invoice #<?=$_SESSION[‘invoice’]?> from <?=$cfg[‘name’]?>’></td>
</tr>
<tr>
<td>To:</td>
<td><input type=’text’ class=’settings’ style=’width:235px;’ name=’to’ value='<?=$info[‘client_email’]?>’></td>
</tr>
<tr>
<td colspan=’2′><textarea class=’settings’ name=’message’ style=’widtH:300px; height:200px;’>Dear <?=$info[‘client_name’]?>,
We have attached an invoice in the amount of <?=$info[‘total’]?><?=$info[‘currency’]?>.

You may pay, view and print the invoice online by visiting the following link:
http://&lt;?=$_SERVER[‘HTTP_HOST’]?><?=str_replace(‘add.php’,”,$_SERVER[‘SCRIPT_NAME’])?>inc/invoicehtml.php?id=<?=encrypt($_SESSION[‘invoice’].”-“.md5($_SESSION[‘invoice’]))?>
Best Regards,
<?=$cfg[‘name’]?>
</textarea></td>
</tr>
<tr>
<td colspan=’2′ align=’center’><input type=’submit’ name=’sendinvoice’ class=’button’ value=’Email invoice to Client’/></td>
</tr>
</table>
</form>