Send email from rails console
Quicker version: ActionMailer::Base.mail( from: “test@example.co”, to: “valid.recipient@domain.example”, subject: “Test”, body: “Test” ).deliver_now
Quicker version: ActionMailer::Base.mail( from: “test@example.co”, to: “valid.recipient@domain.example”, subject: “Test”, body: “Test” ).deliver_now
Header injection isn’t a factor in how you send the mail, it’s a factor in how you construct the mail. Check the email package, construct the mail with that, serialise it, and send it to /usr/sbin/sendmail using the subprocess module: import sys from email.mime.text import MIMEText from subprocess import Popen, PIPE msg = MIMEText(“Here is … Read more
If the server is well configured, eg it has an up and running MTA, you can just use the mail command. For instance, to send the content of a file, you can do this: $ cat /path/to/file | mail -s “your subject” your@email.com man mail for more details.
When you typed in sudo sendmailconfig, you should have been prompted to configure sendmail. For reference, the files that are updated during configuration are located at the following (in case you want to update them manually): /etc/mail/sendmail.conf /etc/cron.d/sendmail /etc/mail/sendmail.mc You can test sendmail to see if it is properly configured and setup by typing the … Read more