title: How to send mail to multiple recipients in Perl?
body: <p>I have to send mail to multiple recipients using Perl. I have to use <a href="https://metacpan.org/pod/Net::SMTP" rel="nofollow"><code>Net::SMTP</code></a> only to send mail.</p>
  
  <p>I have to read from and to mail address from pipe separated file. Format of file is as follows:</p>
  
  <pre><code>abc@gmail.com|pqr@yahoo.com,xyz@gmail.com
  </code></pre>
  
  <p>I have read the line and split it wrt to pipe. Then I stored to part in <code>$mailT</code></p>
  
  <p>I tried using </p>
  
  <pre><code>smtp-&gt;recipient($mailT)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>smtp-&gt;datasend("To: $mailT ");
  </code></pre>
  
  <p>but this is not working.</p>
  
  <p>It gives the error:</p>
  
  <pre><code>Issue RCTP to in the command
  </code></pre>