william1616
Posts: 12
Joined: Sun Aug 26, 2012 9:52 pm

PHP Mail() function

Mon Sep 03, 2012 9:19 pm

Hi,

Does anyone know which of the php packages from the Raspbian apt-get repositories you need to install to get the php mail() function to work?

Repository http://archive.raspbian.org/raspbian/pool/main/p/

Any help appreciated NB i've tried php-horde-mail and php-mail

User avatar
joan
Posts: 14567
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: PHP Mail() function

Mon Sep 03, 2012 9:33 pm

The mail function is documented as part of the php core. So no package should be required.

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: PHP Mail() function

Mon Sep 03, 2012 11:55 pm

I did some hacking around postfix to get mail running on my Ubuntu server and it uses PHP5 to forward mail from a webform.

If you want to post out onto the internet you need to find out the SMTP for your service provider it's to do with spam prevention
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

william1616
Posts: 12
Joined: Sun Aug 26, 2012 9:52 pm

Re: PHP Mail() function

Tue Sep 04, 2012 8:50 am

What do you do with the SMPT once you have found it?

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: PHP Mail() function

Tue Sep 04, 2012 9:36 am

To run postfix mail to the outside wold you need to route any outgoing mail through a relay host this is to stop (or at least reduce) spam generation programs running from home users. If you don't have this you need a fixed ip address from your isp and that will cost you. Its not usually free.

After installing postfix you need to edit the main.cf file to do this you need root access. sudo will do and you need to find the main.cf file it is a text file so you can edit it with the likes of nano and it is usualy in the folder //etc/postfix/

I don't know what your planning for SMPT but SMTP (note spelling) address is the relay host for your ISP and each ISP has it's own and it is not allways obvious.

If you are running outlook allready for your mail it will be in the account settings. But get those last two letters the right way round or it will fail. :D

The line

Code: Select all

myorigin = 
That is also in this file must contain a valid mail address. There's a blog page

http://lenss.nl/2009/01/making-php-mail ... h-postfix/

That runs through setting up and covers some issues that arise out of a clash with sendmail.

This blog also shows you how to use telnet to send a test mail from the command line this will let you know that everything is working before you get all knotted up in the php stuff.

Get it right and you get an email keep going till this telnet exercise works it will save you a lot of heartache.
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

william1616
Posts: 12
Joined: Sun Aug 26, 2012 9:52 pm

Re: PHP Mail() function

Tue Sep 04, 2012 12:36 pm

SMTP - Typo Sorry :(

I'll try this out when i next powerup and let u know

Thanks in advance

william1616
Posts: 12
Joined: Sun Aug 26, 2012 9:52 pm

Re: PHP Mail() function

Tue Sep 04, 2012 4:56 pm

Can't seem to get it working might try this http://www.vishalkumar.in/2009/06/php-m ... -tutorial/

william1616
Posts: 12
Joined: Sun Aug 26, 2012 9:52 pm

Re: PHP Mail() function

Wed Sep 05, 2012 4:14 pm

PHP Mailer works but dont follow tutorial go to google code

Return to “Other programming languages”