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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mailx FROM someone other than me

Status
Not open for further replies.

modfather

MIS
Feb 15, 2000
75
US
I know this sounds like I want to spam, but that's really not the case. :) I'm hoping someone can help me: When I email using "mailx blah@aol.com", the email is sent fine. But the problem is, my "from" email address is something like "jdoe@aol.aol.com". Is there a way I can change the "from" email address to be my primary email address of "jdoe@aol.com"? I'm not sure how my unix email is configured or how it is working with Exchange, but I'm hoping someone can give me an idea where to start...

Thanks!
modfather
 
Yes, with mailx you can use the [tt]-r[/tt] switch. This is the reply to. Most receiving email systems show this as the FROM field. They can still see who it's really from if they can see the headers.

Other email systems allow you to put a "Reply to" address. That's used if you want replies to go to an address other than the one they were originally sent from.

 
SamBones,

Thanks very much - worked perfectly. I neglected to mention another problem. By the way, this is with HPUX 11:

I'm trying to send an email, and attach an ascii file. I want this to be an attachment, not inline text. Is this possible?

Right now, I'm using:

mailx -s MySubject -r myreal@email.com MyRecipient@aol.com < /tmp/filenametoattach

The problem is, this file is included as inline text. I was hoping to make it an attachment. Is that possible?

Many thanks!
modfather
 
Try this...
[tt]
export FNAME=filetoattach.txt
export TO=MyRecipient@aol.com
export REPLY=myreal@email.com

( print &quot;Hello,&quot; ;
print &quot;The file ${FNAME} is attached.&quot; ;
print &quot;Have a Nice Day!&quot; ;
print ;
uuencode ${FNAME} ${FNAME} ) | mailx -s &quot;File ${FNAME} sent $(date)&quot; -r ${REPLY} ${TO}
[/tt]
This will attach the file, plus include a nice little message and a meaningful subject line.

Hope this helps.

(Kudos to Joseph M. for helping me with this one)

 
SamBones,

Thanks! It worked! The only minor problem I have is that Outlook decodes it perfectly, but if I send it to my yahoo.com account, it doesn't. Any idea why?

Thanks again!
modfather
 
Not sure. I don't know Yahoo mail. Every mail system is a little bit different though.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top