using evolution from the linux command line

Asked by efittery

I want to automate emailing data to my customers.

I have figured out how to use a shell script to produce the data, call evolution to set up the email address, subject line and to attach the data file to the email.

Then I have to press the "SEND" button that evolution displays when it pops up the gui for doing email.

How do you automate pressing the "SEND" button? I don't want to sit in front of my computer for hours pressing evolution's send button.

thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Evolution Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Albrecht Mühlenschulte (a7p) said :
#1

evolution mailto:<email address hidden>,<email address hidden>?attach=".xsession-errors"\&subject="test"

should be enough to help you use a protected & (\&) to attach further options. ...

hth,
   a7p

Revision history for this message
efittery (butch-lakeshore) said :
#2

I use the following from a bash shell script.

evolution \
mailto:<email address hidden>?<email address hidden>\&subject="Your IBM data"\&attach=/home/efittery/bin/IBM_Data.cvs

This causes the evolution gui to pop up. At this point, I can press the "SEND" button on the gui and the email with it's attachment gets sent to the email address specified.

I want to eliminate pressing the "SEND" button.

I really don't see anything in your answer that helps me with this.

Am I missing something?

Revision history for this message
Albrecht Mühlenschulte (a7p) said :
#3

Ups, I missread your question ... I'd wonder if that'd be possible - I think it is not ... why not use an other client - a commandline for example *g* ... try mail or mutt.

Revision history for this message
Russ Phillips (avantman42) said :
#4

As a7p said, using a command-line mail client is probably a better option. If you install mutt, you can send an e-mail with an attachment using a command like:
mutt -s "Subject line" -a attachment.jpg <email address hidden> < bodytext.txt

"attachment.jpg" is the attachment, "bodytext.txt" is a text file containing the e-mail body text.

More details at http://www.shelldorado.com/articles/mailattachments.html#mime

Revision history for this message
Brent Creech (brentcreech) said :
#5

It know it's a couple years after the original post...
Try this...It's a close answer but not exactly.
This will save a mail message to the Outbox in evolution, however it's missing the command that forces evolution to Send/Receive, but the next time you send a message in Evolution it will pick up all the mail that is in the Outbox and send it also. It gets you closer because instead of a message stuck in an open GUI waiting for you to click send, its now created and sitting in the Outbox waiting to be sent. If I solve the final piece of the puzzle I'll give that up to you too.

#!/bin/bash
date '+From <email address hidden> %a %b %e %T %Y' > /tmp/autoemail
echo "Subject: Auto_Create_Email" >> /tmp/autoemail
echo "From: A_User <email address hidden>" >> /tmp/autoemail
echo "To: <email address hidden>, <email address hidden>" >> /tmp/autoemail
echo "">> /tmp/autoemail
echo "This message was autocreated" >> /tmp/autoemail
echo "2nd Line" >> /tmp/autoemail
echo "">> /tmp/autoemail
cat /tmp/autoemail >> /home/user/.evolution/mail/local/Outbox
exit 0

Can you help with this problem?

Provide an answer of your own, or ask efittery for more information if necessary.

To post a message you must log in.