Debian / php mail() / apt-get install sendmail fails

So I want to use mail() function in PHP. Does it come with default debian install or do I have to install sendmail or that?

Anyways I tried and I get this…..

/>apt-get install sendmail

Reading package lists… Done

Building dependency tree

Reading state information… Done

Some packages could not be installed. This may mean that you have

requested an impossible situation or if you are using the unstable

distribution that some required packages have not yet been created

or been moved out of Incoming.

The following information may help to resolve the situation:

The following packages have unmet dependencies:

sendmail: Depends: sendmail-bin but it is not going to be installed

E: Broken packages

mail() function returns 1 meaning it was successful however no email is received.

1 Reply

Run apt-get update before trying to install anything new.

If somehow sendmail doesn't work for you, postfix is just as good and possibly more secure as well.

Reply

Please enter an answer
Tips:

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] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct