Send HTML email with mail, mailx, or sendmail? - html

All..
I am asking this question, and yes it might look like a newbie posting a question without search first, but I have a caveat that I need to be considered before marking this as a repeat or duplicate of similar posted questions!
I have "googled" and searched on stackoverflow, and tried just about every combination of parameters and methods to get an email sent by either mail, mailx, or sendmail (don't care, will even consider other methods), and have the client recognize the email as HTML and properly display the message along with an attachment.
My request is to find a way to send an HTML email AND attach a file at the same time, with a single command.
I am using mail and mailx "12.4 7/29/08", and I can not figure out what version of sendmail. I am using "Linux 2.6.32-504.8.1.el6.x86_64" (RHEL 6.6 Santiago) build of RHEL.
Looking for any of the following?
How does one find a program that will allow me to send an email with HTML, attach a file and have it be detected my the email client as HTML with an attachment?
Format a message and its "body" content, and manually encode a file to be attached so that can be sent and have it be detected my the email client as HTML with an attachment?
Combination of both of the above?
I am stumped. Many of the posts I found have told me there is a large variety of mail and mailx versions and distributions that have different patterns. I am not porting this from machine to machine, and not looking for portable bash script code. However, I like writing clean code that is fairly portable and standard, but that would be like having my pie and eating it too! :-)

Mailx html content is in this theme Mailx send html message
Attachment her http://www.unix.com/solaris/183753-mailx-attachment.html
I understood this correctly?

Related

Get raw email message from GMAIL, showing emoji entity codes (not pictographs!)

How can I get the actual raw text of an email in Gmail? By default, Gmail translates the emoji/Goomoji codes into pictographs. I want to see the text codes or unicode -- whatever it is when it is transmitted/reviewed by SMTP.
Is that possible, or can I feed the message file (downloaded as an EML) through a CLI tool or something to decode it?
My goal is to figure out a way to filter on Goomoji/Emojis -- I found an old JS called SpamZero but it doesn't seem to work. I'm hoping I can fix it.

What is the simplest way to set up "reply to this email directly"?

I have a site that people communicate via private message.
I send npemail notifications to these people.
In the email notifications, I want the user to be able to hit reply on the email. My system would then analyze the subject line and write the message to the database for that user.
I have an email server set up (followed instructions to install dovecot and postfix). However, its a very basic set up and I'm completely clueless how to implement the system I just described.
I'm looking for a good overview answer or a link to a tutorial that goes through this.
There's a trick you can make use of: Mails to user+extension#domain go to the same mailbox as mails to user#domain. I'd use that instead of the subject line to find out which message the reply is about – this lets the user choose a custom subject line.
To let mails to a certain user go directly into a program, the probably easiest way is to put a .forward file into his home directory. Into that file, write | <path to executable>. The full mail (including headers) will be handed to the specified executable via stdin and a few environment variables with metadata (e.g. EXTENSION) will be set.
You might want to do man 8 local.

SMTP attachment of type 7Zip in java not recognized as multi-part?

I am trying to send a 7Zip attachment using SMTP (java mail), even after setting proper multi-part and content type as "application/x-7z-compressed", I see it is not shown as attachment, as below, any suggestions what I could be missing ?
Either something messed up the formatting of your post, or you pasted in an image. Either way, it's hard to see exactly what's going on with your message.
Try using the msgshow.java demo program included with JavaMail. It can show you the structure of a message. If it's not showing you what you expect, give us more details. In particular, what do you mean by "is not shown as an attachment"? What's doing the "showing"? Your mail reader?

Drupal 7 - Editing Default Emails in user.module file

I have drupal 7 installed on my live server. I want to edit the default text emails to Html emails which are present in user.module file. I tried changing the core file, deleted cache, deleted browser cache, but it does not work. I have also changed the permission to 777, but it did not work.
I know it is not a good idea to change the default core files, but is it possible to change the drupal core files ??
Thanks
Update
I have installed Html mail module, and i can change the look of the html, however i wish to change the actual text of the default emails.
Update 2
As mentioned in the answer below, i tried checking the the settings page in Drupal, however i could not get the forget password email and new comment email text. Is it possible to add this or edit this using the HTML mail module??
It is really simple.
Goto http://www.yourdomain.com/admin/config/people/accounts/settings
There is an "Emails" section in which you can edit all emails sent by the core user module.
Add HTML Mail module to be sure that Drupal will add the good headers and you are done !
It's definitely possible, at the end of the day the Drupal core files are just plain old PHP. While it's an extremely bad idea to hack core files (it sounds like you already know why) all you'd need to do is change the code to do what you want it to do.
The good news though is that someone has already written a module to do what you want: HTML Mail.
This module allows you to theme emails leaving the system as you would theme a normal Drupal site, and replaces the outgoing emails with those HTML versions per your settings.
All the emails are being sent from the system and the content is editable as we want. To stylize the emails, i am using html mail module as suggested by CLive.
The new account creation, account cancellation emails can be found in "Account settings" page when you login as a admin.
All other emails are set from "Actions" settings page.
I could use html tags in the emails content, i think it worked because i was using html mail module.
I hope this comment helps someone trying to change the core email content from drupal.

Importing csv-style text attachment from gmail into any kind of db/spreadsheet automatically?

Every hour, I get a csv style file (delimited by | (pipe)) delivered via email to a gmail address with a few rows of stuff like 12X98XJ|75.00|0.00||0.00|23.15
I'd like to automatically import to/update a database. I was thinking Google Docs "email to docs" functionality. Except helpfully they seem to have disabled that now.
I feel there MUST be a simple method in existence that does what I want.
Once it's in something where I can get at it with an API, it's plain sailing from then on.
Even something as simple as importing to Amazon SimpleDB would do.
But a good half a day of Googling just leads down disappointing paths.
Two notes:
All email functions are disabled on my server, so the .py scripts I found to retrieve from a local mail store file aren't going to work.
Don't ask me why the data is given to me in such a cack-handed way. It's historical.
I seem to be working with people getting ready to migrate to windows 3.1
What about using the pair of fetchmail + procmail