mlnsharma Posted August 27, 2009 Share Posted August 27, 2009 Hi, I am new to PHP. I use windows XP. I want to send a mail using PHP application to my gmail. I use broadband connection with a username and password. What should i configure - Mail server or anything? I am not aware of the settings. Can anyone suggest and guide me through please ?? <? $to = "aaaaaa@gmail.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "nnnnnn@gmail.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> I used this program. It shows message sent. But i dont find my mail in the inbox.. Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted August 27, 2009 Share Posted August 27, 2009 You will not be able to use php's mail function. It cannot connect to a SMTP server that requires authentication as this cannot be set within your ini file. Since it is a local pc you have no mail transfer agent (mta). Download and use the swiftmailer libraries http://swiftmailer.org/ since you can configure a SMTP server. Read the docs on usage. Quote Link to comment Share on other sites More sharing options...
mlnsharma Posted August 28, 2009 Author Share Posted August 28, 2009 You will not be able to use php's mail function. It cannot connect to a SMTP server that requires authentication as this cannot be set within your ini file. Since it is a local pc you have no mail transfer agent (mta). Download and use the swiftmailer libraries http://swiftmailer.org/ since you can configure a SMTP server. Read the docs on usage. Thank you...I tried using phpmailer yesterday..it worked..I will try this one now... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.