Jump to content

Configure PHP on Linux to send mails by an external SMTP


Recommended Posts

Right now, I use the mail() php function to send mails by using a localhost mail server named postconf. But I wanna use an external SMTP server (gmail) cause I don't want to have a mail server running all the time. My server's on a linux machine.

What do i have to set up? ???

  • 1 month later...

Hello,

I am on the same boat.  I have lamp installed but I can't send mails using php.  I don't need a fully functional mail server, just something to build/test webpages with before uploading them to the server.  I installed ssmtp but I can't figure out how to use it.  Man pages are not helping.  Following shows whats in ssmtp.conf. What should I modify?  I have been at for several days.  Please help me if possible.

#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=postmaster

# The place where the mail goes. The actual machine name is required no 
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=mail

# Where will the mail seem to come from?
#rewriteDomain=

# The full hostname
hostname=ryy

# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
#FromLineOverride=YES

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.