php mail question re default smtp server

For my main domain email I have setup the MX Records to point to a Google Mail account and all works prefect.

I have NOT installed any other email software on my server except the standard Ubuntu image which I understand include simple Postfox. I have also NOT added or configured any email settings in any ini files.

I have a PHP script that uses simple PHP mail to send me notifications and this works great.

But what smtp server is it using to send the emails ?

Is it using my gmail account from the MX Records or something else ?

The reason for my questions is Im looking at upgrading my notifications to also notify others and this may create lots of emails and gmail limit the number of emails you can send per 24 hours. We will upgrade our code to use something else as we understand PHP Mail is not very efficient but for the initial tests its working fine.

Any feedback will be great.

7 Replies

If you've installed postfix then it's sending via that, gmail's quotas won't be a problem.

Thanks obs,

I have not installed Postfix, but assumed this was included as default in the Ubuntu image and used by PHP Mail(). Sorry, maybe my assumption is wrong. I have not installed any additional email software/modules.

You probably have some mail server running on there possibly sendmail run dpkg -l | grep mail and it'll list all pages with 'mail' in the name/description, you'll be looking for sendmail, postfix or exim.

Thanks again…

libmailtools-perl 2.05-1 Manipulate email in perl programs

mime-support 3.48-1ubuntu1 MIME files 'mime.types' & 'mailcap', and sup

postfix 2.7.0-1ubuntu0.2 High-performance mail transport agent

Postfix is added as standard and being used for email sending.

So does this means my Google account is not being used in any way to send email when PHP Mail is used ?

That's correct.

On Unix-like systems, mail just calls the local "sendmail" binary or equivalent and passes the data to be mailed to it.

Only on Windows does it connect to an external server via SMTP to send out the mail.

Heh that's new I wonder when postfix got snuck into the images by default.

Thanks for all the help.

No Gmail limitions is good.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct