sandeepm Posted April 18, 2015 Share Posted April 18, 2015 $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 More sharing options...
thescientist Posted April 18, 2015 Share Posted April 18, 2015 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 More sharing options...
sandeepm Posted April 20, 2015 Author Share Posted April 20, 2015 yes how can i check ??? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 22, 2015 Share Posted April 22, 2015 It's fairly difficult to check if an address actually exists. If you want to make sure that a value is in the correct form for an email address then you can use the filter_var function, there are examples here:http://php.net/manual/en/function.filter-var.php Link to comment Share on other sites More sharing options...
thescientist Posted April 22, 2015 Share Posted April 22, 2015 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now