How do I install sendmail for PHP on replit?

Whenever I run the mail() function it says sendmail not installed. How can I install sendmail?

Hey there! There should be a package icon in your toolbar where you could find sendmail.

There’s no send mail package in the package icon

I;m sorry, there is no package manger for php

Are there any other solutions?

@MattDESTROYER could you help?

Looking into it, I would start with trying to get it through packages like you said, but there is also a form of package manager for PHP that would be worth checking out, I’ll see where I get.

1 Like

Can’t figure this one out, maybe @UMARismyname or @ShaneAtReplit can help? I figure this might involve working with Nix, and while I found system-sendmail on Nix, I couldn’t figure out how to configure it correctly.

Hey!

Configuring packages is not my expertise, but the last time I looked into adding sendmail, we concluded that it requires an email server, which we don’t support.

I’ll look into this again and see if I can find anything!

2 Likes

Hey!

Here is the response we had given a user regarding the use of sendmail on Replit:

Unfortunately Google Cloud containers (which we use to host Repls) forbid sending email directly from GCP, so the only path forward here is plugging in a remote SMTP server.

(this was in regards to a user asking about sendmail for PHP)

2 Likes

Try something like the PHPMailer library which allows you to connect to an existing SMTP server - so you could send it through a gmail account, for instance. mail won’t work on Replit for the reasons Shane mentioned above

3 Likes

Does sending an email directly to an email server like @codingMASTER398 's newsletter does no longer work?

1 Like

It still works! I use a package called nodemailer-direct-transport. It’ll make your email look a bit more phishy and go in the Junk folder most of the time, but it works!

2 Likes

I wish Replit would give us some way to manage DNS records for our repl.co domains, so we could make things like email work

2 Likes

ooo, so your saying I could get into replit in a few years, without that much expertise in nix?

1 Like