title: Yahoo smtp is not sending mails but same code is working fine for gmail.Need help.working on local server
body: <p>Sample code of yahoo SMTP mailer</p>
  
  <p>This code is working properly for Gmail but for yahoo its showing</p>
  
  <pre><code>SMTP -&gt; ERROR: Failed           to connect to server: (0) 
  SMTP Error: Could not connect to SMTP host. Message has been sent.......
  
  with port no 465
  SMTP -&gt; ERROR: MAIL not accepted from server: 501 Syntax error in arguments 
  
  The following From address failed: root@localhost Message has been sent.......
  
  
  &lt;?php
  include('class.phpmailer.php');
  include('class.smtp.php');
  try {
  $mail = new PHPMailer();  
  $mail-&gt;IsHTML(true);
  $mail-&gt;SMTPDebug  = 1;
  $mail-&gt;IsSMTP();
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;SMTPSecure = "ssl";
  $mail-&gt;Host = "smtp.mail.yahoo.com"; //smtp host
  $mail-&gt;Port = 25; //port no.
  $mail-&gt;Username = "eg@yahoo.com"; //account 
  $mail-&gt;Password = "pass"; //password
  $fromname = "name";
  $email="someone@gmail.com";
  $abcd="-------------";
  $To = trim($email,"\r\n");
    $tContent   = '';
  
    $tContent .="&lt;table width='550px' colspan='2' cellpadding='4'&gt;
          &lt;tr&gt;&lt;td align='center'&gt;&lt;img src='imgpath' width='100' height='100'&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td height='20'&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;
              &lt;table cellspacing='1' cellpadding='1' width='100%' height='100%'&gt;
              &lt;tr&gt;&lt;td align='center'&gt;&lt;h2&gt;YOUR TEXT&lt;h2&gt;&lt;/td&gt;&lt;/tr/&gt;
              &lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td align='center'&gt;Name: ".trim($abcd,"\r\n")."&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td align='center'&gt;ABCD TEXT: ".$abcd."&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;                
              &lt;/table&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;/table&gt;";
  
    $mail-&gt;FromName = $fromname;        
    $mail-&gt;Subject = "Your Details."; 
    $mail-&gt;Body = $tContent;
    $mail-&gt;AddAddress($To); 
    //$mail-&gt;set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low
    $mail-&gt;Send();
      echo 'Message has been sent.......';
  } catch (phpmailerException $e) {
  echo $e-&gt;errorMessage();
  }
  ?&gt;
  </code></pre>