Link to home
Start Free TrialLog in
Avatar of GK GK
GK GK

asked on

Sending Mail from Linux servers

Hi Experts,

Can some body help me with code to send mails from Linux server which is connected to internet.

Thanks in Advance

Regards,
Avatar of mankowitz
mankowitz
Flag of United States of America image

there are many different mail programs you can use, but the simplest is to type

%mail person@example.com

from the command line, using ^D to end the message.

Of course, you have to make sure that your linux machine doesn't have any blocked ports, has sendmail running, is associated with a DNS so that others can find you, has a trusted site that it can relay mail from, etc, etc.

here is a tutorial on setting up sendmail: http://computernetworkingnotes.com/network-administrations/sendmail-server.html
Avatar of madunix
madunix

You could use sendmail,,,,

In /etc/mail/sendmail.mc file contains following line:
dnl define(`SMART_HOST',`smtp.your.provider')

Replace "smtp.your.provider" with the fully qualified domain name to look like this:
define(`SMART_HOST',`my.relay.server')

Then restart
# service sendmail restart
Is the machine already setup to send email?  

There is a lot that goes into sending mail.  You can configure postfix or sendmail to use your ISP email account to send mail which is the easiest way.  What flavor of linux are you using?
ASKER CERTIFIED SOLUTION
Avatar of Ernesto Couso Artiles
Ernesto Couso Artiles
Flag of United States of America 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