- This topic is empty.
-
AuthorPosts
-
August 9, 2013 at 1:58 am #146214iamRDMParticipant
I’m having a billing php script which has a feature of sending email to clients directly through it. But I’m not able to send email. I’m using godaddy and using wordpress on the same server but it can send emails..
Please tell me is there any way to make it work.
August 9, 2013 at 5:50 pm #146315AnonymousInactive@iamRDM
Try this: http://www.w3schools.com/php/php_mail.asp
and if error will be show read it and write hereAugust 9, 2013 at 6:37 pm #146321chrisburtonParticipantW3Schools isn’t reliable. If there’s a PHP error, you should see it.
Please post your code, removing sensitive info, first.
August 11, 2013 at 10:32 am #146397iamRDMParticipant@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://<?=$_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>August 11, 2013 at 5:25 pm #146456iamRDMParticipant@tarq it says “oops something went wrong”
And I tried that “the php manual” it worked like a charm.
And about that php.ini file I’ll check n post it within a while.
August 13, 2013 at 1:11 am #146602iamRDMParticipantthe manual was useful
but my script isn’t working.
this is the code of page which has email feature http://pastebin.com/k9d89c9vand this is the link of email script http://pastebin.com/YbnU0zQk i.e. geekmail
August 13, 2013 at 6:56 am #146664iamRDMParticipantit sends the invoice information to my customers
August 13, 2013 at 7:22 am #146679iamRDMParticipanterror_reporting(0);
@include “db.php”;
@include “geekmail.php”;
$res=mysql_query(“select * from config”)or die(mysql_error());
while($row=mysql_fetch_array($res)){
$cfg[$row[‘name’]]=$row[‘value’];
}
session_start();function mailer($to,$subject,$message,$attach=”){
global $cfg;
$geekMail = new geekMail();
$geekMail->setMailType(‘html’);
$geekMail->from($cfg[’email’], $cfg[‘name’]);
$geekMail->to(array($to));
$geekMail->subject($subject);
$geekMail->message(nl2br($message));
if($attach){
$geekMail->attach($attach);
}
if (!$geekMail->send())
{
return 0;
}else{
return 1;
}
}August 13, 2013 at 7:33 am #146681iamRDMParticipantI’m unable to find the php.ini file :(
where is it located in godaddy shared linux hosting any idea ? -
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.