From: <ex...@us...> - 2013-05-12 03:37:27
|
Revision: 5938 http://sourceforge.net/p/web-erp/reponame/5938 Author: exsonqu Date: 2013-05-12 03:37:23 +0000 (Sun, 12 May 2013) Log Message: ----------- 11/5/2013 Exson: Make EDI modules can send mail via SMTP in files EDIProcessOrders.php, EDISendInvoices.php, EDISendInvoices_Reece.php Modified Paths: -------------- trunk/EDIProcessOrders.php trunk/EDISendInvoices.php trunk/EDISendInvoices_Reece.php Modified: trunk/EDIProcessOrders.php =================================================================== --- trunk/EDIProcessOrders.php 2013-05-12 03:12:17 UTC (rev 5937) +++ trunk/EDIProcessOrders.php 2013-05-12 03:37:23 UTC (rev 5938) @@ -543,9 +543,13 @@ $Recipients = array($EDICustServPerson); } + if($_SESSION['SmtpSetting']==0){ + $MessageSent = $mail->send($Recipients); + }else{ + $MessageSent = SendmailBySmtp($mail,$Recipients); + } - $result = $mail->send($Recipients); echo $EmailText; } /* nothing in the email text to send - the message file is a complete dud - maybe directory */ @@ -568,4 +572,4 @@ } } -?> \ No newline at end of file +?> Modified: trunk/EDISendInvoices.php =================================================================== --- trunk/EDISendInvoices.php 2013-05-12 03:12:17 UTC (rev 5937) +++ trunk/EDISendInvoices.php 2013-05-12 03:37:23 UTC (rev 5938) @@ -216,7 +216,12 @@ $mail->SetSubject('EDI Invoice/Credit Note ' . $EDITransNo); $mail->addAttachment($attachment, 'EDI_INV_' . $EDITransNo, 'application/txt'); $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>'); - $MessageSent = $mail->send(array($CustDetails['ediaddress'])); + if($_SESSION['SmtpSetting']==0){ + $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>'); + $MessageSent = $mail->send(array($CustDetails['ediaddress'])); + }else{ + $MessageSent = SendmailBySmtp($mail,array($CustDetails['ediaddress'])); + } if ($MessageSent==True){ echo '<br /><br />'; @@ -262,4 +267,4 @@ } /*loop around all the customers enabled for EDI Invoices */ include ('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/EDISendInvoices_Reece.php =================================================================== --- trunk/EDISendInvoices_Reece.php 2013-05-12 03:12:17 UTC (rev 5937) +++ trunk/EDISendInvoices_Reece.php 2013-05-12 03:37:23 UTC (rev 5938) @@ -302,9 +302,14 @@ $attachment = $mail->getFile( "EDI_INV_" . $TransNo .".txt"); $mail->SetSubject('EDI Invoice/Credit Note ' . $TransNo); $mail->addAttachment($attachment, 'EDI_INV_' . $TransNo . '.txt', 'application/txt'); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>'); - $MessageSent = $mail->send(array($CustDetails['ediaddress'])); + if($_SESSION['SmtpSetting']==0){ + $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . '<' . $_SESSION['CompanyRecord']['email'] . '>'); + $MessageSent = $mail->send(array($CustDetails['ediaddress'])); + }else{ + $MessageSent = SendmailBySmtp($mail,array($CustDetails['ediaddress'])); + } + if ($MessageSent==True){ echo '<BR><BR>'; prnMsg(_('EDI Message') . ' ' . $TransNo . ' ' . _('was sucessfully emailed'),'success'); |