So I am using MUTT on my Ubuntu server where I want to email a particular file to the user once he enters his email address in a webpage (hosted on the server).
I am storing his response as a .json file in the server but now I want to send email to the email address provided by him.
As far as i know, MUTT has a command to send the email to a recipient
mutt -s "Mail Subject" [email protected] -a attachment.zip < mail_body.txt
What I want is, to get the username@domain
from a file rather than hardcoding it.
Any leads on how to do this will be appreciated.
Thanks
Turns out that I had to create an executable script for this job.
I stored the email to a variable by using EMAIL=cat email.txt
and then used this EMAIL variable as the recipient.