cancel
Showing results for 
Search instead for 
Did you mean: 

sending email

SOLVED
Go to solution
Piotr Kirklewski
Super Advisor

sending email

Hi there

Im trying to make mail sending email from my private account.

(nither sendmail or postfix are installed on my machine).

Is there any way to pass my smtp server username and password to this command:


echo "text"\mail myemail@example.com

???

Best Regards

Peter





Jesus is the King
7 REPLIES
Ivan Ferreira
Honored Contributor
Solution

Re: sending email

Hi, normally, SMTP does not requires authenticantion, but if so, you can try some perl SMTP script like this:

http://www.logix.cz/michal/devel/smtp/index.xp?show_selected=1&msgid=31
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: sending email

Shalom,

Yes,

vi /etc/mail/sendmail.cf

Change

DS

to

DShostnameofsmtprelayserver

Read that last line carefully because its a clue. You need to KNOW the hostname of the SMTP relay server before you start.

Or

DS
[192.168.0.10]

Where the IP address is the IP address of the SMTP relay server. This will work even if name resolution is down on your network.

Please note very carefully however that the intended relay server may require configuration to accept the mail. What configuration depends on what the OS and Mail Transfer system is on that system.

Then you need to restart sendmail.

service sendmail restart

You don't really need to run sendmail to get mail off the box, but for the sake of simplicity, thats the easy way to go.

mailq
# displays if mail is stuck in the outbound mail queue. There should never be mail there unless you have a problem.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Piotr Kirklewski
Super Advisor

Re: sending email

Well

My account information (given by my provider)is something like that:

address: myname@wp.pl
smtp server: smtp.wp.pl
pop3 server: pop3.wp.pl

password: myverysecurepassword

Those are the credentials I'm using to configure mail clients under windows.
My question is:

Is there any way to tell mail to send message using my account information?

As I said before nor sendmail or postfix are installed. (do I have to install them ?)

Best Regards

Peter
Jesus is the King
Ivan Ferreira
Honored Contributor

Re: sending email

The sender address is set by the MUA (mail client). This information does not have to match the information used to retrieve the mails from the POP server.

This means that you can use any sender address if you specify so in your mail client or command line.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Piotr Kirklewski
Super Advisor

Re: sending email

Yep

That's exactly my question:

What comand should I use to SEND email from my unix system, using external provider.

Regards

Peter
Jesus is the King
Stuart Browne
Honored Contributor

Re: sending email

Ok.

You either use a client (Thunderbird, Evolution, Mutt) and use those POP/SMTP values in the client.

If you want to use the 'ol "mail" command to do some command-line automated notifications etc. etc., yes, you will need sendmail or postfix.

Both sendmail and postfix use the 'smart host' mentality to forward all SMTP stuff to a remote SMTP server. Doing SMTP Authentication on that connection is quite different between the two services, so pick one, and we'll help you further.
One long-haired git at your service...
Ivan Ferreira
Honored Contributor

Re: sending email

You should configure postfix, which is very simple comparing with sendmail.

If this is a red hat based system, do this:

Ensure that postfix is installed
rpm -qa |grep postfix

Then
service sendmail stop
chkconfig sendmail off
alternatives --config mta
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Server: AkamaiGHost Mime-Version: 1.0 Content-Type: text/html Content-Length: 215 Expires: Sun, 27 May 2018 08:21:37 GMT Date: Sun, 27 May 2018 08:21:37 GMT Connection: close Bad Request

Bad Request

Your browser sent a request that this server could not understand.

Reference #7.5f955b8.1527409297.0