send emai using php code
Moderator: General Moderators
-
issacthiyagarajan
- Forum Newbie
- Posts: 1
- Joined: Thu Jun 24, 2010 12:36 am
send emai using php code
iam new to php. i want to send mail to gmail account from my application. a test mail. i google it and tried many things but the mail was not receiving. plz help me regarding this. send me code for this mail application
Re: send emai using php code
Hi,
Well PHP's inbuild mail system is usually a good place to start (http://www.php.net/manual/en/function.mail.php).
It's worth bearing in mind that on some setups you can't send mail and even if it gets sent self-generated mail often looks like spam - have you checked your gmail spam folder?
Is it your own server with internet access or a shared environment? Might be worth looking at the logs, especially maillog and checking that whatever mail delivery agent such as sendmail is running.
Cheers,
Dave.
Well PHP's inbuild mail system is usually a good place to start (http://www.php.net/manual/en/function.mail.php).
It's worth bearing in mind that on some setups you can't send mail and even if it gets sent self-generated mail often looks like spam - have you checked your gmail spam folder?
Is it your own server with internet access or a shared environment? Might be worth looking at the logs, especially maillog and checking that whatever mail delivery agent such as sendmail is running.
Cheers,
Dave.
-
internet-solution
- Forum Contributor
- Posts: 220
- Joined: Thu May 27, 2010 6:27 am
- Location: UK
Re: send emai using php code
OP wants to send e-mail via gmail account, not the local mail server.davex wrote:Well PHP's inbuild mail system is usually a good place to start (http://www.php.net/manual/en/function.mail.php).
Its less likely that anybody will send you the whole application. If you have tried many things, why not post some code so that someone here can help you.issacthiyagarajan wrote:i google it and tried many things but the mail was not receiving. plz help me regarding this. send me code for this mail application
Some clues - you will need to use fsockopen to establish a SMTP connection to gmail server. Then you will have to use TLS challenge response protocol to authenticate your account to gmail.
Re: send emai using php code
Maybe I am mistaken but looks like he wants to send to not from.issacthiyagarajan wrote:iam new to php. i want to send mail to gmail account from my application. a test mail. i google it and tried many things but the mail was not receiving. plz help me regarding this. send me code for this mail application
If the only need is to send to gmail anyway then he could use any standard SMTP mailer and connect to one of the gmail MX servers but using localised mail delivery will enable transmission to any destination account for future use.
Though internet-solution is entirely correct if you want to send from your gmail account you'll need to use authenticated SMTP. I'm pretty sure a few of the off-the-peg PHP mail applications will support this.
HTH,
Dave.
-
internet-solution
- Forum Contributor
- Posts: 220
- Joined: Thu May 27, 2010 6:27 am
- Location: UK
Re: send emai using php code
Davex is right. I have misread the first post.
Thank you for correcting me.
Thank you for correcting me.
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: send emai using php code
Swiftmailer.davex wrote:...of the off-the-peg PHP mail applications...