LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-01-2008, 09:14 AM   #1
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Rep: Reputation: 57
echo mypage.htm | mutt -s "hello news" myemail@gmail.com


Hello,

bash:
I would like to send an email with the content of it of HTML, so that it sends and displays an html when I open it wiht google mail.

Is there any way ? I guess that mutt should be capable of sending text as html.

I use nbsmtp and not sendmail.

thanks

Last edited by frenchn00b; 03-01-2008 at 09:26 AM.
 
Old 03-02-2008, 06:50 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Do want to send the html file as an attachment, like this?
Code:
mutt -s "testing" -a February-26-2008.html mygmail@gmail.com < /dev/null
 
Old 03-03-2008, 01:06 AM   #3
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by homey View Post
Do want to send the html file as an attachment, like this?
Code:
mutt -s "testing" -a February-26-2008.html mygmail@gmail.com < /dev/null
I would like it in the text (not in attachment)

more like

Code:
cat page.htm  | mutt -s "hello"  emailaddressse@gmail.com
 
Old 03-03-2008, 05:00 AM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
That worked on my fc8 box
Code:
cat page.htm  | mutt -s "hello"  emailaddressse@gmail.com
rpm -qa |grep mail
mailx-8.1.1-46.fc7
mailcap-2.1.25-1.fc8

rpm -qa |grep mutt
mutt-1.5.17-2.fc8
 
Old 03-03-2008, 02:55 PM   #5
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by homey View Post
That worked on my fc8 box
Code:
cat page.htm  | mutt -s "hello"  emailaddressse@gmail.com
rpm -qa |grep mail
mailx-8.1.1-46.fc7
mailcap-2.1.25-1.fc8

rpm -qa |grep mutt
mutt-1.5.17-2.fc8
thanks, but still not workign
the content of the email says:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="e
and no web.

I did:
Code:
 
 
apt-get install mutt procmail
apt-get install screen
apt-get install python-dbus bug-buddy  reportbug openssl
apt-get install openssl libssl0.9.7 libssl-dev
 apt-get install mime-support
I too compiled nbsmtp
cd nbsmtp-1.00   ; make clean  ; ./configure --enable-ssl ; make ; make install

echo 'set sendmail="/usr/local/bin/nbsmtp"' > /home/frenchn00b/.muttrc
echo 'unset use_from' >> /home/frenchn00b/.muttrc
echo "relayhost=smtp.gmail.com" >  /home/frenchn00b/.nbsmtprc
echo "fromaddr=myemailaddress@gmail.com" >>  /home/frenchn00b/.nbsmtprc
echo "domain=myemailaddress@gmail.com" >>  /home/frenchn00b/.nbsmtprc
echo "auth_user=myemailaddress@gmail.com" >>  /home/frenchn00b/.nbsmtprc
echo "auth_pass=XXXXXXXXXXXXXXXXXXXXXXX" >>  /home/frenchn00b/.nbsmtprc
echo "auth_mech=login" >>   /home/frenchn00b/.nbsmtprc
echo "port=587" >>   /home/frenchn00b/.nbsmtprc
echo "use_tls=True" >>   /home/frenchn00b/.nbsmtprc
echo "use_starttls=True" >>   /home/frenchn00b/.nbsmtprc
echo "debug=2" >>   /home/frenchn00b/.nbsmtprc


and I have
Code:
 dpkg -l | grep mail
ii  fetchmail                            6.3.6-1etch1                             SSL enabled POP3, APOP, IMAP mail gatherer/f
ii  gmail-notify                         1.6.1-3                                  A Gmail Notifier
ii  iceape-mailnews                      1.0.11~pre071022-0etch1                  Iceape Mail & Newsgroups and Address Book
ii  kmail                                3.5.5.dfsg.1-6                           KDE Email client
ii  libksieve0                           3.5.5.dfsg.1-6                           KDE mail/news message filtering library
ii  libktnef1                            3.5.5.dfsg.1-6                           Library for handling KTNEF email attachments
ii  libmailtools-perl                    1.74-1                                   Manipulate email in perl programs
ii  libmailutils1                        1.1+dfsg1-3.1                            GNU Mail abstraction library
rc  mailutils                            1.1+dfsg1-3.1                            GNU mailutils utilities for handling mail
ii  mailx                                8.1.2-0.20050715cvs-1                    A simple mail user agent
ii  metamail                             2.7-52                                   implementation of MIME
ii  mime-support                         3.39-1                                   MIME files 'mime.types' & 'mailcap', and sup
ii  mutt                                 1.5.13-1.1etch1                          text-based mailreader supporting MIME, GPG,
ii  procmail                             3.22-16                                  Versatile e-mail processor
ii  python-twisted-mail                  0.3.0-1                                  An SMTP, IMAP and POP protocol implementati

Code:
 dpkg -l | grep mutt
ii  mutt                                 1.5.13-1.1etch1                          text-based mailreader supporting MIME, GPG


Code:
 dpkg -l | grep mailcap
ii  mime-support                         3.39-1                                   MIME files 'mime.types' & 'mailcap', and sup
you see the error somewhere ?

I am looking forward to reading you and best wishes
Frenchn00b
 
Old 03-06-2008, 04:12 PM   #6
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 510

Rep: Reputation: 53
Try "-i" for "Specify a file to include into the body of a message."
 
Old 03-07-2008, 09:05 PM   #7
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
H E L P

with

I get this still in the content of the email and still no htm :
Code:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en">
<head>
<meta name="robots" content="noindex,follow" />
<base href="" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="generator" content="vBulletin
Code:
mutt -i /tmp/index.htm  -a /tmp/index.htm  someone@gmail.com < /dev/null
same problem with :
Code:
mutt -x -i /tmp/index.htm    someone@gmail.com < /dev/null
H E L P Please
 
Old 03-07-2008, 09:18 PM   #8
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
my .nbsmtp has:
Code:
relayhost=smtp.gmail.com
fromaddr=myemail@gmail.com
domain=myemail@gmail.com
auth_user=myemail@gmail.com
auth_pass=*pass*
auth_mech=login
port=587
use_tls=True
use_starttls=True
debug=2
 
Old 03-07-2008, 09:21 PM   #9
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Could maybe alternatives to nbsmtp would work better ? please could you provide any help or configuration ?
thanks

Code:
~$ apt-cache search smtp | grep smtp
clamsmtp - virus-scanning SMTP proxy
drac - Dynamic Relay Authorization Control (pop-before-smtp)
esmtp - User configurable relay-only MTA
esmtp-run - User configurable relay-only MTA
hotsmtp - SMTP to Hotmail (HTTPmail) gateway
libesmtp-dev - LibESMTP SMTP client library development files
libesmtp5 - LibESMTP SMTP client library
libnet-smtp-server-perl - A native Perl SMTP Server implementation
libnet-smtpauth-perl - Perl module that provides SMTP authentication (Net::SMTP_auth)
libsmtpguard-dev - Development files for smtpguard
libsmtpguard1 - Shared library of smtpguard
msmtp - light SMTP client with support for server profiles
msmtp-mta - light SMTP client with support for server profiles
php-net-smtp - PHP PEAR module implementing SMTP protocol
pop-before-smtp - watch log for POP/IMAP auth, notify MTA to allow relay
postfix-smtpguard - smtpguard policy service daemon for Postfix
proxsmtp - multi purpose SMTP Proxy
qpsmtpd - Flexible SMTP daemon for network-level spam detection
smtp-refuser - Simple spam-block with refusal message
smtpd - Mail proxy for firewalls with anti-spam and anti-relay features
smtpfeed - SMTP feed -- SMTP Fast Exploding External Deliver for Sendmail
smtpguard - smtp flow control
ssmtp - extremely simple MTA to get mail off the system to a mail hub
 
Old 03-07-2008, 09:34 PM   #10
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
I just configured esmtp and I got that
after esmtp me@gmail.com < /tmp/page.htm

Code:
<meta name="keywords" content="Linux,how to,tutorial,operating system,linux,red hat,mandrake,security,linux help,installation,question,forum" />
<meta name="description" content="LinuxQuestions.org offers a free Linux forum where Linux newbies can ask questions and Linux experts can offer advice. Topics include security, installation, networking and much more." />



<!-- CSS Stylesheet -->
<link rel="stylesheet" type="text/css" href="http://www.linuxquestions.org/questions/clientscript/vbulletin_css/style-cc6a10ca-00007.css" id="vbulletin_css" />

<!-- / CSS Stylesheet -->

<script type="text/javascript">
still not working

H E L P Please
 
Old 03-08-2008, 10:29 AM   #11
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 510

Rep: Reputation: 53
mutt -i your.html -e "my_hdr Content-Type: text/html" -s foobar you@gmail.com < /dev/null
 
Old 03-08-2008, 11:01 AM   #12
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by Su-Shee View Post
mutt -i your.html -e "my_hdr Content-Type: text/html" -s foobar you@gmail.com < /dev/null
Sorry if I am pretty crap in linux, but I got the following error :
Code:
mutt -i /tmp/page.htm -e "Content-type: text/html; charset=us-ascii"  -s foobar myemail@gmail.com < /dev/null
Error in command line: Content-type:: unknown command
and without -e and string, it is still not working...
that's not so easy.

I am looking forward to reading you !!

thank you in advance
 
Old 03-09-2008, 02:44 PM   #13
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 510

Rep: Reputation: 53
You forgot the parameter (a mutt parameter) "my_hdr".

You just change the mime type in the mail header and the mail with html content gets interpreted as html.

My command:

mutt -i your.html -e "my_hdr Content-Type: text/html" -s foobar you@gmail.com < /dev/null

You tried:

mutt -i /tmp/page.htm -e "Content-type: text/html; charset=us-ascii" -s foobar myemail@gmail.com < /dev/null
 
Old 03-09-2008, 03:18 PM   #14
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by Su-Shee View Post
You forgot the parameter (a mutt parameter) "my_hdr".

You just change the mime type in the mail header and the mail with html content gets interpreted as html.

My command:

mutt -i your.html -e "my_hdr Content-Type: text/html" -s foobar you@gmail.com < /dev/null

You tried:

mutt -i /tmp/page.htm -e "Content-type: text/html; charset=us-ascii" -s foobar myemail@gmail.com < /dev/null
Code:
mutt -i your.html -e "my_hdr Content-Type: text/html" -s foobar you@gmail.com < /dev/null
IT WORKS !!!!!
I THANK YOU PLENTY !!!!!!!!!!!!

Please find my link
 
Old 04-19-2009, 02:44 PM   #15
frenchn00b
Senior Member
 
Registered: Jun 2007
Location: E.U., Mountains :-)
Distribution: Debian, Etch, the greatest
Posts: 2,561

Original Poster
Rep: Reputation: 57
Quote:
Originally Posted by frenchn00b View Post
Code:
mutt -i your.html -e "my_hdr Content-Type: text/html" -s foobar you@gmail.com < /dev/null
IT WORKS !!!!!
I THANK YOU PLENTY !!!!!!!!!!!!

Please find my link
It didnt work !! again, so I got a solution:

to be cont.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mutt question: "How can I configure mutt for not automarking as read??" xowl Linux - Software 0 09-25-2007 09:09 AM
BASH: How to NOT echo to screen with "if echo $x | grep ".*"; then" eur0dad Programming 9 07-27-2006 02:14 PM
(echo -n "standby" > /sys/power/state) only allowed for root? brynjarh Debian 5 02-14-2005 09:08 AM
What is "Error sending message, child exited 67 (User unknown.)."? using mutt jonathanztaub Linux - General 0 05-17-2004 09:04 AM
mutt says: "~/Mail/Inbox: No such file or directory (errno = 2)" realos Linux - General 1 08-01-2002 03:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration