Tag Info

Hot answers tagged

18

mailx can use SMTP. It's configure file is ~/.mailrc One example is mailx using Gmail's SMTP. The configure can even be in one command: mailx -v -s "$EMAIL_SUBJECT" \ -S smtp-use-starttls \ -S ssl-verify=ignore \ -S smtp-auth=login \ -S smtp=smtp://smtp.gmail.com:587 \ -S from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)" \ -S smtp-auth-user=$FROM_EMAIL_ADDRESS ...


11

Normally, mail and derivatives (and almost any other Unix MUA) use the traditional sendmail interface - /usr/bin/sendmail, provided by almost all MTAs (postfix, exim, sendmail, courier). This is the traditional Unix way. Once a message is submitted through sendmail, your MTA handles message transmission. Depending on configuration, it may either connect ...


4

I would advise to use sendEmail: sendEmail-1.56 by Brandon Zehm <caspian@dotconf.net> Synopsis: sendEmail -f ADDRESS [options] Required: -f ADDRESS from (sender) email address * At least one recipient required via -t, -cc, or -bcc * Message body required via -m, STDIN, or -o message-file=FILE Common: -t ADDRESS ...


2

Instead of specifying the recipient on the command line, call sendmail with -t and have your script generate a to: header. (You might as well do a subj: header while you're at it.) Then when there's no output, there's no recipient, and thus no mail.


2

The easiest way would be to call sendmail fom within your script. That way you can control whether or not any mail is sent to you. Alternatively, you could make your script return a success code if it fails and run sendmail only if the script exits "correctly": $ my-job >/tmp/message && cat /tmp/message | sendmail The && tells bash to ...


2

A few things to try. #!/bin/sh -xv Try redirecting stderr with two greater than signs, 2>>&1 . The first will give you step-by-step output of your script. I'd try it first without redirecting stderr to your log file. Cron should mail you a copy of the output. You can see exactly where it goes wrong. The second. Maybe you have an error that's ...


2

Have you read the manpage man mailx? Look for write (w) command. This can write attachments.


2

If this computer is located on a home network connection, you are likely blocked by your ISP from sending mail directly. Most ISPs expect you to authenticate to their mail server to send mail. In that case, follow these slackware specific directions to set up Client-Side SMTP AUTH + SMART_HOST


2

Found it. To open without being kicked out if there's no new mail: mailx -f To get the header list again once in: h


2

The mail terminal program should do the trick. It usually works "straight out of the box" to allow users/programs to send messages locally, inside the system. Type mail -s 'subject line' someone@gmail.com and hit return. Then type your message and close/send using Ctl-D.


1

The following depends on your installed MTA, but because of security implications, mail is usually not delivered to root. You need to set up root as a mail alias to one of your "normal" users and read root's mail in that mailbox.


1

there is an alternative without local mta like sendmail/postix. debian package ssmtp info from rpm description: Summary : Extremely simple MTA to get mail off the system to a Mailhub URL : http://packages.debian.org/stable/mail/ssmtp License : GPLv2+ Description : A secure, effective and simple way of getting mail off a system to your mail ...


1

You are sure the cron job works, as per your comments - however, you have tested it manually running the job while you are logged-in. The thing is that the jobs ran by cron do not take into account the settings and environment variables you have with your current user, so you probably need to source the .bash_profile settings file for the user as a step ...


1

Just get rid of the account wrapper you put around the settings. nail.rc Instead of: # other mail config ... account gmail { set smtp-use-starttls set smtp-auth=login set smtp=smtp://smtp.gmail.com:587 set smtp-auth-user=username@gmail.com set smtp-auth-password="blahblah" } Use: # other mail config ... set smtp-use-starttls set ...



Only top voted, non community-wiki answers of a minimum length are eligible