Link to home
Start Free TrialLog in
Avatar of santocki
santockiFlag for United States of America

asked on

How to setup PHP sendmail or SMTP for home computer behind cable modem using Fedora Linux

Hi, I am using a home pc with Fedora Linux installed. I am trying to send email messages with a PHP script running under Apache server. I was wondering if it is possible:

1. To send emails using sendmail using my pc behind a home user cable modem (optimum online)?

2. If it's not possible using sendmail, how can I set it up to use SMTP provided by my ISP just like I use with email clients?


Thank you.
SOLUTION
Avatar of Joe Wu
Joe Wu
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Be aware that many ISPs block port 25 (SMTP) for exactly this reason.  They don't want every joe-schmoe running an email service through their network.  You should probably talk to your provider to find out how this idea is affected by your terms of service.  You can do an informal test by forwarding port 25 to your fedora box, then browsing to http://canyouseeme.org.  Be sure to remove the forward afterwards, or you'll be spamming the world in no time.

Fedora comes with sendmail pre-installed.  If you can use the mail command from the prompt and successfully send/receive mail to an external account, you should be good to go.

> 1. To send emails using sendmail using my pc behind a home user cable modem (optimum online)?
no most mails will be rejected when delivered from dial-ups or directly marked as spam. So directly delivering the mails from your home-computer is no good idea.

> 2. If it's not possible using sendmail, how can I set it up to use SMTP provided by my ISP just like I use with email clients?
Use a mailer class in PHP which handels the SMTP-Auth at your providers side like
http://swiftmailer.sf.net
http://phpmailer.sf.net
Avatar of santocki

ASKER

Thanks for the replies, but I am trying to find a simple solution like setting up a default SMTP server for all of my PHP scripts I am testing, which are the scripts developed by others so I can test them fully before uploading them to my server at the hosting company. So I won't add any kind of emailing routine by myself, because they already exists in these scripts.

Is it possible to set a default SMTP server at php.ini or http.conf?
Note: Setting up a default SMTP means to use my ISP's SMTP address, not to setup a SMTP on my computer.

I have tried to send messages using PHP's default configuration that uses sendmail, but it won't work.

Thank you.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial