• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

Sending e mail from the command prompot

Dear Experts

I know there was a way that I could make a file in VI editor and then use the command prompt to send the mail in linux. I have forgotton the command. Can anyone show mw how we use to do it.
Thank You
0
syedasimmeesaq
Asked:
syedasimmeesaq
  • 5
  • 4
1 Solution
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
See if this link helps any:
http://www.wb.nic.in/email/mailnote.html

I THINK you want to compose a message and for the body use ~r filename to read in the file you created in VI.
0
 
syedasimmeesaqAuthor Commented:
I am a newbie ..can you let me know step by step. Thank You
0
 
syedasimmeesaqAuthor Commented:
See I have a file like this

$mailstring =  "To: asim@mydomain.com" .
"From: Frank.Harrison@hisdomain.com\n" .
"Subject:Thanks For your reply\n\n" .
"Thank You for your reply. We will contact you soon. Have a good day";

Now I want to include this file as it is from the command prompt and send it to frank using I think sendmail? I totally spaced out how I used to do this
Thanks
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Lee W, MVPTechnology and Business Process AdvisorCommented:
For example, type

mailx joeuser@somedomain.com
you'll be prompted for the subject; enter one.
Then you'll have a blank line.  Type ~r filename to read in the file you want as the body of the message
A message should appear indicating "filename" lines/characters
Then to complete the message, type a single line with the . character.
That should send it.
0
 
syedasimmeesaqAuthor Commented:
it does send it ..but it doesn't send it with my name. It sends it with root<root@local.localdomain> or something. I have no idea what the hell is that you know. I need my name there..not the root :) Thank You for your help.
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Don't log is as root!  Why are you logged in as root?  mailx uses whatever user you're logged in as.

If your a linux newbie, DON'T START BAD HABBITS - NEVER log in as root except for maintenance.  Even then, setup sudo or su to let you change over to root when needed.

0
 
syedasimmeesaqAuthor Commented:
ok even if I login as a different name....it doesn't send out my right domain name that I want. it says localhost something.
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
Now you're getting into linux networking which is really beyond the scope of this question.  You should probably ask a seperate question there.  In short, you have to change the computer's domain and name, but that's not something I can help you with at the moment.
0
 
syedasimmeesaqAuthor Commented:
Thats fine my friend. I will give you the points
Thanks for your time
I will ask somewhere else
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now