How to send a html email with the bash command “sendmail”?

The following works: ( echo “From: ${from}”; echo “To: ${to}”; echo “Subject: ${subject}”; echo “Content-Type: text/html”; echo “MIME-Version: 1.0”; echo “”; echo “${message}”; ) | sendmail -t For troubleshooting msmtp, which is compatible with sendmail, see: https://wiki.archlinux.org/index.php/Msmtp https://superuser.com/a/868900/9067

Check mail is sent successfully or not on Laravel 5

I’m not entirely sure this would work but you can give it a shot /** * Send Mail from Parts Specification Form */ public function sendMail(Request $request) { $data = $request->all(); $messageBody = $this->getMessageBody($data); Mail::raw($messageBody, function ($message) { $message->from(‘yourEmail@domain.com’, ‘Learning Laravel’); $message->to(‘goper.zosa@gmail.com’); $message->subject(‘Learning Laravel test email’); }); // check for failures if (Mail::failures()) { // … Read more

Sending HTML mail using a shell script

First you need to compose the message. The bare minimum is composed of these two headers: MIME-Version: 1.0 Content-Type: text/html … and the appropriate message body: <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> <html> <head><title></title> </head> <body> <p>Hello, world!</p> </body> </html> Once you have it, you can pass the appropriate information to the mail … Read more

Send SMTP email using System.Net.Mail via Exchange Online (Office 365)

Fixed a few typos in the working code above: MailMessage msg = new MailMessage(); msg.To.Add(new MailAddress(“someone@somedomain.com”, “SomeOne”)); msg.From = new MailAddress(“you@yourdomain.com”, “You”); msg.Subject = “This is a Test Mail”; msg.Body = “This is a test message using Exchange OnLine”; msg.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential(“your user … Read more