Page 1 of 1

Rejected email address from same domain I authenticate on!

Posted: Sat May 02, 2009 4:50 pm
by IgotDreams
I have an error that I cannot get past.

The Details;

- Swift Version: 4.0.3
- PHP Version: 5.2.6
- Connection Method: SMTP

My Config File;

Code: Select all

 
$MailSendName = 'John Doe';
$MailSendAcct = 'destination@domain.com';
$MailFromName = 'Form Processing';
$MailFromAcct = 'noreply@domain.com';
$MailServ = 'smtp.domain.com';
$MailPort = '25';
$MailUser = 'user@domain.com'';
$MailPass = 'password';
 
My Page displaying the form

Code: Select all

 
require_once('Swift/lib/swift_required.php'); include('includes/config.php');
 
My Form (which is an include by the way)

Code: Select all

 
$MailSubj = "domain.com :: Contact Request";
$MailBody = 'the body of the email, blah, blah';
// USE SMTP Authentication (Server, port, username, password)
$transport = Swift_SmtpTransport::newInstance($MailServ, $MailPort)->setUsername($MailUser)->setPassword($MailPass);
$MailProc = Swift_Mailer::newInstance($transport);
// Create a message (subject, from name, from email, send name, send email, message body)
$message = Swift_Message::newInstance($MailSubj)->setFrom(array($MailFromAcct => $MailFromName))->setTo(array($MailSendAcct => $MailSendName))->setBody($MailBody);
if ($MailProc->send($message, $failures)) {
    print '<h3>Thank You!</h3><p>We have received your request and will be contacting you shortly.</p>';
}else{
    print '<p>Problem: ';
    print_r($failures);
    print '</p>';
}
 
Anyways, I have this form all over the web and now this one on this server is not working. So I added this today from another post (http://swiftmailer.org/docs/failures-byreference) I that is why I now have this;

Code: Select all

 
if ($MailProc->send($message, $failures)) {
    print '<h3>Thank You!</h3><p>We have received your request and will be contacting you shortly.</p>';
}else{
    print '<p>Problem: ';
    print_r($failures);
    print '</p>';
}
 
Now I am getting this;

Problem: Array ( [0] => destination@domain.com )

This is email is on the same domain that I am authenticating agaisn't and sending from. So does this mean I have a rejected address? If so, what does that mean, how do I get around it or fix it?

Re: Rejected email address from same domain I authenticate on!

Posted: Sat May 02, 2009 8:54 pm
by Chris Corbyn
Yep, if the email address ends up in $failures, then Swift Mailer tried to send it through the SMTP server, but the SMTP server rejected it.

Try putting this (for debug only) before the send() call:

Code: Select all

$logger = new Swift_Plugins_Loggers_EchoLogger(true); //True for HTML escaping, false otherwise
 
$mailProc->registerPlugin(new Swift_Plugins_LoggerPlugin($logger));