- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Send an email by SMTP from a file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2004 01:55 PM
03-18-2004 01:55 PM
Send an email by SMTP from a file
When I send the mail I do in this way.
telnet
But this instruction cause many errors.
My_file:
HELO atl.hp.com
MAIL FROM:
RCPT TO:
DATA
To: "My friend"
Subject: Test
I need send this mail.
I expected that all is rigth
Bye
.
quit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2004 03:59 PM
03-18-2004 03:59 PM
Re: Send an email by SMTP from a file
telnet $hostname 25 << EOF
HELO atl.hp.com
MAIL FROM:
RCPT TO:
DATA
To: "My friend"
Subject: Test
I need send this mail.
I expected that all is rigth
Bye
..
EOF
This kind of script could obviously be modifed and used to relay spam through a smtp server with light security.
That would be a very bad idea. Plus illegal in all 50 states now.
I've spent some time learning how to defeat such scripting and can configure any sendmail server to do it.
I'm sure your purpose is good and apologize if I've gone over the line here.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2004 07:43 PM
03-18-2004 07:43 PM
Re: Send an email by SMTP from a file
I forgot to mention that I want to send several mail messages from a HP9000 over UNIX, using shells and that I have created an unique file with information for some of my clients that requested it.
But in both ways, executing the script or using a text file like entry, the server sends me error messages until they are so many that the execution is interrupted in both ways.
Using the script like a shell or using the command:
"TELNET HOSTNAME 25 << EOF
Where My_file contains the following lines:
HELO My_domain
MAIL FROM:
RCPT TO:
DATA
To: "My friend"
Subject: Test
I need send this mail.
I expected that all is rigth
Bye
.
EOF
Apparently a way exists to send the mails using SMTP and SFF (Send From File),
But I don't know how to do it.
Can you help me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2004 08:07 PM
03-18-2004 08:07 PM
Re: Send an email by SMTP from a file
This kind of stuff normaly doesn't work properly, if you need to emulate a connection use expect.
Anyway, why not use somthing like this :
cat $FILE | mailx -s "Subject" name@domain.com
My 2 cents (of euro :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2004 09:44 PM
03-18-2004 09:44 PM
Re: Send an email by SMTP from a file
What is the error message you get? You might try out a telnet to the other server's port 25 to see if there is a sendmail listening. Perhaps your problem is with that. If not, it might be the sendmail config rejects your mail because sendmail is configured by someone like SEP... For instance, you do a HELO atl.hp.com, but there is no link between atl.hp.com and your IP address...
By doing the stuff you try by hand, you get a better view of error messages.
It might also help if you could take a look at the maildaemon log on the machines you're trying to connect to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2004 01:19 AM
03-19-2004 01:19 AM
Re: Send an email by SMTP from a file
If thats the case you could use uuencode as said in the following thread :
http://forums1.itrc.hp.com/service/forums/questionanswer.do?admit=716493758+1079705834401+28353475&threadId=7923
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2004 01:43 AM
03-19-2004 01:43 AM
Re: Send an email by SMTP from a file
#mailx -s "Subject here" user@domain.com < filename
#echo "This is the body text" | mailx -s "Subject here" user@domain.com
#cat filename | mailx -s "Subject here" user@domain.com
This one uses mail rather than mailx and allows you include the subject in the echo statement which gives you more control.
#echo "Subject: test\nbody text" | mail user@domain.com
Regards,
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2004 07:31 PM
03-21-2004 07:31 PM
Re: Send an email by SMTP from a file
cat filename | uuencode filename | mail username@domain
if you want the file in dos format
cat filename | ux2dos filename | uuencode filename | mail username@domain
Regards,
John.