ale wiadomość nie przesyła się na adres: admin@gmail.com
System Ubuntu 9.10 mam zainstalowane (opisy z synaptica)
PHP 5.2
php-mail (PEAR's Mail:: package defines the interface for implementing mailers
under the PEAR hierarchy, and provides supporting functions useful
in multiple mailer backends. Currently supported are native PHP mail()
function, sendmail and SMTP.)
php-net-smtp (Provides an implementation of the SMTP protocol using
PEAR's Net_Socket class.)
Plik z PHPMailer
$mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "localhost"; // specify main and backup server $mail->SMTPAuth = false; // turn on SMTP authentication $mail->Port = 25; //$mail->Username = "root"; // SMTP account username //$mail->Password = "root"; // SMTP account password $mail->From = "from@example.com"; $mail->FromName = "Mailer"; $mail->AddAddress("admin@gmail.com", "Josh Adams"); $mail->WordWrap = 50; // set word wrap to 50 characters $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Here is the subject"; $mail->Body = "This is the HTML message body <b>in bold!</b>"; $mail->AltBody = "This is the body in plain text for non-HTML mail clients"; if(!$mail->Send()) { exit; }
PHP.INI
Cytat
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i