Jump to content

swift mailer not sending the mails


sandeepm

Recommended Posts

$email = $_POST['email'];require_once "/var/www/html/swift_mailer/swift_required.php";// Create the Transport$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com',***,'ssl')->setUsername('*******@****.com')->setPassword('***');// Create the Mailer using your created Transport$mailer = Swift_Mailer::newInstance($transport);// Create a message$message = Swift_Message::newInstance('Test Swift Mail Setup')->setFrom(array('******@***.com' => 'Statreferral Admin'))->setTo($email)->setBody($content,'text/html');// Send the message$result = $mailer->send($message);

 

What is the wrong in this code pplease suggest me......

how can i check whether username contain mail server or not.....

 

 

 

Link to comment
Share on other sites

are you checking for errors or adding error reporting? whats the value of $result?

 

also, not sure what you mean by

 

how can i check whether username contain mail server or not.....

 

are you asking how you can check if an email address really exists?

Link to comment
Share on other sites

Or send the user a confirmation email with a confirmation link validating they are the owner of said email address.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...