Levélküldés mail()-lel v. phpmailer-rel Invitelen keresztül
mail():
php.ini beállítás
Hibaüzenet:
phpmailer:
bemásolom a class.phpmailer.php-t és a class.smtp.php-t.Hibaüzenet:
Segítséget szeretnék kérni hogy mi lehet a hiba!!!!!
■ php.ini beállítás
[mail function]
;For Win32 only.
SMTP = mail.invitel.hu
smtp_port = 25
;For Win32 only.
sendmail_from = sajat##kukac##invitel.hu
;For Win32 only.
SMTP = mail.invitel.hu
smtp_port = 25
;For Win32 only.
sendmail_from = sajat##kukac##invitel.hu
Hibaüzenet:
Warning: mail(): SMTP server response: 530 5.7.0 No AUTH command has been given.
phpmailer:
bemásolom a class.phpmailer.php-t és a class.smtp.php-t.
- <?php
- require("class.phpmailer.php");
- $mail = new PHPMailer();
- $mail->IsSMTP(); // set mailer to use SMTP
- $mail->Host = "mail.invitel.hu"; // specify main and backup server
- $mail->SMTPAuth = true; // turn on SMTP authentication
- $mail->Username = "felhaszn"; // SMTP username
- $mail->Password = "jelszo"; // SMTP password
- $mail->From = "sajat##kukac##invitel.hu";
- $mail->FromName = "Mailer";
- $mail->AddAddress("cimzett##kukac##invitel.hu", "cimzett név");
- $mail->WordWrap = 50; // set word wrap to 50 characters
- $mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
- $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
- $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())
- {
- echo "Message could not be sent. <p>";
- echo "Mailer Error: " . $mail->ErrorInfo;
- exit;
- }
- echo "Message has been sent";
- ?>
Message could not be sent.
Mailer Error: The following From address faild: sajat##kukac##invitel.hu
Mailer Error: The following From address faild: sajat##kukac##invitel.hu
Segítséget szeretnék kérni hogy mi lehet a hiba!!!!!
mail egyértelmű
mail()
egyértelmű. Nem azonosítod magad, az invitel SMTP pedig (mint minden rendes SMTP) nem enged anonim emial kuldest. A második példád próbáld ki egyszerűbb kóddal, és inkrementálisan haladj a gond megtalálása felé. Lehet, hogy az invitel bevizsgálja, hogy pontosan afelhaszn##kukac##invitel.hu
nevet használod-e küldésre.