<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Inviare mail con 2 allegati]]></title><description><![CDATA[<p dir="auto">Ciao,<br />
utilizzo il seguente metodo per l'invio di una mail con allegato:</p>
<pre><code class="language-php"> protected function sendAttachments(){                        
$obj_dump = new dbdump;            
$obj_dump-&gt;doDump();            
$res_attachment = $obj_dump-&gt;str_filepath;                        
$str_filez = fopen($res_attachment, "r");            
$str_contents = fread($str_filez, filesize($res_attachment));            
$encoded_attach = chunk_split(base64_encode($str_contents));            
fclose($str_filez);                        
$str_attach_name = 'dump.sql';            
$str_object = 'Files';                                     
$str_head = 'From: SECURITY' . STR_DOMAIN_MAIL . "\n";            
$str_head.= 'Reply-To: NOREPLY' . STR_DOMAIN_MAIL . "\n";            
$str_head.= 'X-Mailer:' . STR_MAIL_CLIENT . "\n";            
$str_head.= "MIME-version: 1.0\n";           
 $str_head.= "Content-type: multipart/mixed;\n";            
$str_head.= " boundary=\"Message-Boundary\"\n";            
$str_head.= "Content-transfer-encoding: 7BIT\n";            
$str_head.= "X-attachments: $str_attach_name";                                
$str_body = "--Message-Boundary\n";           
 $str_body.= "Content-type: text/html; charset=iso-8859-1\n";            
$str_body.= "Content-transfer-encoding: 7BIT\n";           
 $str_body.= "Content-description: Mail message body\n\n";            
$str_body.= "&lt;!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"&gt;";           
 $str_body.= "&lt;HTML&gt;&lt;HEAD&gt;";            
$str_body.= "&lt;META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\"&gt;";                
$str_body.= "&lt;/HEAD&gt;";            
$str_body.= "&lt;BODY&gt;";            
$str_body.= LANG_NOREPLY_MAIL . "\n &lt;br /&gt;";            
$str_body.= LANG_MSGMAIL_FILES . "\n &lt;br /&gt;";            
$str_body.= "&lt;/BODY&gt;&lt;/HTML&gt;";            
$str_body.= "\n\n--Message-Boundary\n";            
$str_body.= "Content-type: text/plain; name=\"$str_attach_name\"\n";            
$str_body.= "Content-Transfer-Encoding: BASE64\n";            
$str_body.= "Content-disposition: attachment; filename=\"$str_attach_name\"\n\n";            
$str_body.= "$encoded_attach\n";            
$str_body.= "--Message-Boundary--\n";                                     
if(mail(STR_TECHNICAL_MAIL, $str_object, $str_body, $str_head))             
return true;            
else            
 return false;        
}
</code></pre>
<p dir="auto">Vorrei però modificarlo in modo da poter mandare 2 allegati. Come si può fare?</p>
<p dir="auto">Saluti,</p>
<p dir="auto">carlostefano</p>
]]></description><link>https://dev.connect.gt/topic/52724/inviare-mail-con-2-allegati</link><generator>RSS for Node</generator><lastBuildDate>Mon, 30 Nov 2026 02:54:15 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/52724.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 04 Nov 2007 16:38:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inviare mail con 2 allegati on Tue, 06 Nov 2007 18:00:37 GMT]]></title><description><![CDATA[<p dir="auto">in questo post mi sembra che si prenda in considerazione tale possibilita', o meglio attachment multipli</p>
<p dir="auto"><a href="http://it2.php.net/manual/it/ref.mail.php#77405" rel="nofollow ugc">http://it2.php.net/manual/it/ref.mail.php#77405</a></p>
<p dir="auto">non chiedetemi di capirci qualcosa pero' <img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/f71a0c43-865f-4388-9868-8b387eebeeb1-mmmm.gif?v=2190ae3dadd" class="not-responsive emoji emoji-customizations emoji--mmm" style="height:1.4em;width:auto;vertical-align:middle" title=":?" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/632948</link><guid isPermaLink="true">https://dev.connect.gt/post/632948</guid><dc:creator><![CDATA[olaola]]></dc:creator><pubDate>Tue, 06 Nov 2007 18:00:37 GMT</pubDate></item><item><title><![CDATA[Reply to Inviare mail con 2 allegati on Sun, 04 Nov 2007 18:06:59 GMT]]></title><description><![CDATA[<p dir="auto">Ciao carlostefano e Benvenuto nel ForumGT..</p>
<p dir="auto">Intanto grazie per aver postato questa interessante funzione..</p>
<p dir="auto">Vediamo se il forum riesce a produrre la modifica che potrebbe essere utile a molti..</p>
<p dir="auto"><img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/54a3bffb-5e4a-4eb8-81dc-99b2072e5d05-175.gif?v=2190ae3dadd" class="not-responsive emoji emoji-customizations emoji--ciauz" style="height:1.4em;width:auto;vertical-align:middle" title=":ciauz:" alt="" /></p>
]]></description><link>https://dev.connect.gt/post/632947</link><guid isPermaLink="true">https://dev.connect.gt/post/632947</guid><dc:creator><![CDATA[mz]]></dc:creator><pubDate>Sun, 04 Nov 2007 18:06:59 GMT</pubDate></item></channel></rss>