Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I might be wrong because I don't use IIS but the code you provided would actually use a native MTA not SMTP. As far as I know you have to use the <code>IsSMTP()</code> method to let PHPMailer know that you intend to use SMTP.</p> <p>Something like this:</p> <pre><code>&lt;? $path_of_attached_file = "Images/marsbow_pacholka_big.jpg"; require 'include/PHPMailer_5.2.1/class.phpmailer.php'; try { $mail = new PHPMailer(true); //New instance, with exceptions enabled $body = $message; //"&lt;p&gt;&lt;b&gt;Test&lt;/b&gt; another test 3.&lt;/p&gt;"; $mail-&gt;IsSMTP(); // telling the class to use SMTP $mail-&gt;Host = "mail.yourdomain.com"; // SMTP server $mail-&gt;SMTPDebug = 2; $mail-&gt;SMTPAuth = true; // enable SMTP authentication $mail-&gt;Host = "mail.yourdomain.com"; // sets the SMTP server $mail-&gt;Port = 25; // set the SMTP port $mail-&gt;Username = "yourname@yourdomain"; // SMTP account username $mail-&gt;Password = "yourpassword"; // SMTP account password $mail-&gt;AddReplyTo("admin@example.com","Admin"); $mail-&gt;From = "admin@example.com"; $mail-&gt;FromName = "Admin"; $mail-&gt;AddAddress($to); $mail-&gt;Subject = "First PHPMailer Message"; $mail-&gt;AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail-&gt;WordWrap = 80; // set word wrap $mail-&gt;MsgHTML($body); $mail-&gt;IsHTML(true); // send as HTML if($attach){ $mail-&gt;AddAttachment($path_of_attached_file); } $mail-&gt;Send(); echo 'Message has been sent.'; } catch (phpmailerException $e) { echo $e-&gt;errorMessage(); } ?&gt; </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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