Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendmail vs. mailx

Status
Not open for further replies.

JavaDude4

Programmer
Jul 14, 2000
6
US
Hi,<br>&nbsp;I am currently using mailx on HP-UX 10.20 to send emails with variable subjects, bodies, and attachments. I need to provide for the ability to alter either the reply-to or from field so that when someone replies to these emails (which all come from the same Unix account) the email is directed to the specified account. I have been able to use Sendmail to modify the from field to accomplish this but can not find a way to modify the Subject field using this utility. Does anyone know of a way to send emails from script which provides for variable From fields, Subjects, Bodies and attachments.<br><br>Thanks,<br>Steve<br>
 
I had trouble with this as well, have you tried (can't remember how I got around it) something like this?<br><FONT FACE=monospace><b><br>mailx recipient &lt;&lt;-!<br>Subject: Hi there<br>Hi recipient, how are you etc...<br>!<br></font></b><br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Hi Mike,<br>&nbsp;&nbsp;Thanks for the reply. I haven't tried breaking the email up onto different lines like that but I am not sure how that is going to enable me to specify a reply-to or from field? If I use sendmail in a similar manner I may be able to get it work using this approach since it has a parameter which allows for this field to be set. Thanks again....<br>Steve<br>
 
Hi again,<br>&nbsp;&nbsp;I just tried your recommendation with some success. I was able to use Sendmail to specify the Subject and From address but when I do this I am no longer able to attach a document. I am using the following syntax <br><br>uuencode email_template testAttachment ¦ sendmail <A HREF="mailto:-femailAddress@email.com">-femailAddress@email.com</A> <A HREF="mailto:emailAddress@email.com">emailAddress@email.com</A> &lt;&lt;!<br>&gt; Subject: Test<br>&gt; !<br><br>Unfortunately, the testAttachment does not appear in the email when I do this however if I leave off the trailing &lt;&lt;! then it does appear but then I can't set the Subject. Any ideas how I can get around this?<br><br>Thanks alot,<br>Steve<br><br>
 
Try breaking it down into separate steps<br><br>cat &gt; /tmp/f.f &lt;&lt;-!<br>Subject: Hi there<br>!<br>uuencode email_template testAttachment&nbsp;&nbsp;&gt;&gt;/tmp/f.f<br><br>sendmail <A HREF="mailto:-fuser@somewhere.com">-fuser@somewhere.com</A> <A HREF="mailto:luckyguy@somewhereelse.com">luckyguy@somewhereelse.com</A> &lt; /tmp/f.f<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Worked like a charm. I wish I would've found this forum sooner. These are by far the fastest and most knowledgable responses I have gotten on a user forum.<br><br>Thanks,<br>Steve<br>
 
Thanks Steve - much appreciated. &lt;smile&gt; <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Ok Mike, one more question. I have everything working as desired with one exception. When I use sendmail, the email&nbsp;&nbsp;address I specify ends up in the BCC: field and not in the To: field when the email is received and viewed. With mailx it appears in the To: field as one would expect. I suppose this could be attributed somehow to my email reader (Groupwise on NT) but since mailx works right I kind of doubt it. I know it is trivial but I think it would be enough to confuse the people who will be receiving these emails.<br><br>Thanks,<br>Steve<br>
 
don't know......<br><br>need to have a look at the sendmail man page - no HP box here - will have to be tomorrow<br><br>there should be a command line switch though - try &quot;man sendmail&quot; and page through it &lt;grin&gt; (it's not pretty) <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
I am new to sendmail. Could you help me setup the config files and show me the command line?
 
Hi Jim,

What is it you're trying to do and on what kind of machine, version of UNIX etc?

Sendmail is a bit funny.... Some things that sound really easy take ages -- and a first class honors degree in strangeness. And other things, that sound hard, just need a one line change in the sendmail.cf file..... Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top