Mail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Mail

Post by Straterra »

I have an Earthlink account..and I was wondering, could I send email through PHP from that account to people? If not, what must I do to be able to send email?
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

dont know about EL but you can send email by setting up a STMP server address in your php.ini file (windows), ask your ISP about it, they should give you a address, put that in there, restart the server and use osemthing like.

Code: Select all

<?php
mail("to@somewhere.com", "subject", "your message", "from: your own address");
?>
yes, leave that "from:" part in there, replace the rest with your own email, i suggest searching google for [google]email with php tutorial[/google].

good luck
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

PHP doesn't really login to your account to send it. You just specify who it's from, so it's as if you sent it from your account. Make sure you always use a real from address because a lot of mail servers just bounce fake ones these days.

eg. donotreply@mysite.com (make sure to actually make a donotreply account.)
Post Reply