Hi,
Im using swiftmailer to submit forms on my website.But whenever i submit form i get this error:
Fatal error: Uncaught exception 'Swift_Connection_Exception' with message 'Expected response code(s) [250] but got response 501' in /home/yourwino/public_html/plexum/phpapi/class/swiftmail/Swift.php:252 Stack trace: #0 /home/yourwino/public_html/plexum/phpapi/class/swiftmail/Swift.php(252): Swift::assertCorrectResponse() #1 /home/yourwino/public_html/plexum/phpapi/class/swiftmail/Swift.php(305): Swift->assertCorrectResponse(Object(Swift_Events_ResponseEvent), 250) #2 /home/yourwino/public_html/plexum/phpapi/class/swiftmail/Swift.php(262): Swift->command('EHLO *.yourwino...', 250) #3 /home/yourwino/public_html/plexum/phpapi/class/swiftmail/Swift.php(222): Swift->handshake(Object(Swift_Events_ResponseEvent)) #4 /home/yourwino/public_html/plexum/phpapi/class/swiftmail/Swift.php(95): Swift->connect() #5 /home/yourwino/public_html/plexum/phpapi/functions/functions.php(4161): Swift->__construct() #6 /home/yourwino/public_html/plexum/phpapi/class/websignup.php(965): Functions->sendmail() #7 /home/yourwino/public_html/plexum/phpa in /home/yourwino/public_html/plexum/phpapi/class/swiftmail/Swift.php on line 252
Divay
Uncaught exception 'Swift_Connection_Exception' with message
Moderators: Chris Corbyn, General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
How are you instantiating swift? 501 is "syntax error" and I can see it in your connection line. You cannot pass *.domain.com as a domain. It has to be valid. Swift uses $_SERVER["SERVER_NAME"] if you don't pass a domain in the constructor. I don't really see how that value could come from there. Are you passing a wildcard in the constructor?

Code: Select all
$swift = new Swift(new Swift_Connection_SMTP("smtp.domain.com"), "some.valid.domain.tld");