![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 36 Pomógł: 0 Dołączył: 24.11.2008 Ostrzeżenie: (0%) ![]() ![]() |
Witam. Męcze się z wysłaniem emaila ze strony php. Cały czas wyskakuje mi, że nie może połączyć się z SMTP. Ściągnąłem klsę PHPmailer i jest to samo tylko nie wiem czy dobrze ustawiłem.
Tak wygląda kod PHP
i w class.smtp.php zmieniłem: $host = "ssl://smtp.gmail.com"; $port = 465; Co jeszcze trzeba zrobić? Jest to serwer lokalny. Czy ma znaczenie konfiguracja outlooka i czy cos trzeba zmienic w php.ini Ten post edytował bubu77 4.12.2008, 14:45:40 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Moderatorzy Postów: 8 989 Pomógł: 1550 Dołączył: 8.08.2008 Skąd: Słupsk/Gdańsk ![]() |
Człowieku... i inni ludzie. Nauczcie sie CZYTAĆ!
w ściągnietej paczce w folderze docs i pliku "use_gmail.txt" pisze DOKŁADNIE jak korzystać z poczty na gmail CODE <?php // example on using PHPMailer with GMAIL include("class.phpmailer.php"); include("class.smtp.php"); // note, this is optional - gets called from main class if not already loaded $mail = new PHPMailer(); $body = $mail->getFile('contents.html'); $body = eregi_replace("[\]",'',$body); $mail->IsSMTP(); $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port $mail->Username = "yourname@gmail.com"; // GMAIL username $mail->Password = "password"; // GMAIL password $mail->From = "replyto@yourdomain.com"; $mail->FromName = "Webmaster"; $mail->Subject = "This is the subject"; $mail->AltBody = "This is the body when user views in plain text format"; //Text Body $mail->WordWrap = 50; // set word wrap $mail->MsgHTML($body); $mail->AddReplyTo("replyto@yourdomain.com","Webmaster"); $mail->AddAttachment("/path/to/file.zip"); // attachment $mail->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment $mail->AddAddress("username@domain.com","First Last"); $mail->IsHTML(true); // send as HTML if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent"; } ?> W dodatku co to jest za zapis? Kod $email="[email="nazwa@gmail.com"]nazwa@gmail.com[/email]"; // Recipients email ID Przecież on nie powinien zadziałać Ten post edytował wookieb 4.12.2008, 15:08:50 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 4.10.2025 - 19:53 |