how to send email using PHP Code?
Printable View
how to send email using PHP Code?
Moved From The CodeBank
This is well-detailed on PHP.net's mail() page.
you need a smtp server, you could use an email client like mozilla thunderbird and use hotmail for example for your email sender... i gave up in this project because i couldn't get it working so i just bought a http host and used the mail function...
Thunderbird alone is not an SMTP server (mail transfer agent / MTA), it is a mail user agent (MUA).
MTA's can be downloaded for both Windows (via IIS) and Linux (via Sendmail). The purpose of the MTA is to resolve the mail transfer (MX) record in the domain part of each recipients address and relay the mail to recipients MTA.
true but it can be used to send mails and i couldn't get the smtp connection configured...
I don't know what that has to do with the original question but the original poster asked for code to send mail using php not via an email client.
Edit:
The only code you need to use is the code SambaNeko linked to as well as a hosting services which can run php.
@Justa
I think what you're referring to is setting up a HTML form to use the users default email client in which to mail the form fields, am I right?
If I am right you seriously need to reconsider how you email forms.
Like VisualAd said, an email client is not an SMTP server.