Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax Jquery in PHPMailer SMTP
    primarykey
    data
    text
    <p>I have a problem in using phpmailer using ajax jquery. It will not send email to my recipient please help me here are the codes:</p> <p>For my popupjob.php where it will process my ajax: $(document).ready(function(){ $('.submit').click(function(){</p> <pre><code> for (var a=0; a &lt; document.checkform.jobclient.length; a++) { if (document.checkform.jobclient[a].checked){ var agentId = document.checkform.jobclient[a].value; var dataString = 'action=sendMail&amp;companyId=&lt;?=$_SESSION['ses_companyid']?&gt;&amp;agentId=' + agentId; $.ajax({ cache: 'false', type: "POST", url: "ajaxfunction.php", data: dataString, success: function(msg){ } }); } } }); </code></pre> <p>});</p> <p>My problem really is in my ajax.php. It will not send my email to the email address I inputted.</p> <pre><code>function func12(){ include('adodb/adodb.inc.php'); include "include/manager_shared.php"; ?&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;PHPMailer - SMTP basic test with authentication&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php //error_reporting(E_ALL); error_reporting(E_STRICT); date_default_timezone_set('America/Toronto'); require_once('include/class.phpmailer.php'); //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(); $body = file_get_contents('include/contents.html'); $body = eregi_replace("[\]",'',$body); $mail-&gt;IsSMTP(); // telling the class to use SMTP // SMTP server $mail-&gt;SMTPDebug = 2; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail-&gt;SMTPSecure= "ssl"; $mail-&gt;SMTPAuth = true; // enable SMTP authentication $mail-&gt;Host = "smtp.mail.yahoo.com"; // sets the SMTP server $mail-&gt;Port = 465; // set the SMTP port for the GMAIL server $mail-&gt;Username = "username@domain"; // SMTP account username $mail-&gt;Password = "mypassword"; // SMTP account password $mail-&gt;SetFrom('username@domain', 'First Last'); $mail-&gt;AddReplyTo("username@domain","First Last"); $mail-&gt;Subject = "PHPMailer Test Subject via smtp, basic with authentication"; $mail-&gt;AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail-&gt;MsgHTML($body); $address = "johnDoe@gmail.com"; $mail-&gt;AddAddress($address, "John Doe"); if(!$mail-&gt;Send()) { echo "Mailer Error: " . $mail-&gt;ErrorInfo; } else { echo "Message sent!"; } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p> <pre><code>switch($_POST['action']){ case 'sendMail': $output = func12(); break; default: $output = ''; } echo $output; </code></pre> <p>}</p> <p>?></p> <p>Please help me. Replies are much appreciated........By the way I am using facebox in pop-upping my form. Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload