Qui è una parte del file in php che permette la selezione dei 3 differenti metodi di invio emails da sito web:
Codice PHP:
<select name=\"email_method\">
<option value=\"smtp\"".iif($settings[email_method]=="smtp"," selected=\"selected\"").">SMTP
<option value=\"sendmail\"".iif($settings[email_method]=="sendmail"," selected=\"selected\"").">Sendmail
/*Ho aggiunto la seguente stringa di comando(che non c'era) per l'opzione MAIL*/
<option value=\"mail\"".iif($settings[email_method]=="mail"," selected=\"selected\"").">Mail
</select>
Qui è una porzione del file phpMailer che esegue l'invio delle emails:
Codice PHP:
/**
* Sends mail using the PHP mail() function.
* @access private
* @return bool
*/
function MailSend($header, $body) {
$to = "";
for($i = 0; $i < count($this->to); $i++)
{
if($i != 0) { $to .= ", "; }
$to .= $this->to[$i][0];
}
if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)
{
$old_from = ini_get("sendmail_from");
ini_set("sendmail_from", $this->Sender);
$params = sprintf("-oi -f %s", $this->Sender);
$rt = @mail($to, $this->EncodeHeader($this->Subject), $body,
$header, $params);
}
else
$rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
if (isset($old_from))
ini_set("sendmail_from", $old_from);
if(!$rt)
{
$this->SetError($this->Lang("instantiate"));
return false;
}
return true;
}
*Non serve l'indirizzo del tuo sito*
Rodolfo