Solved

Mail program problem...

Posted on 2000-04-24
2
146 Views
Last Modified: 2010-03-05
Hi folk,

I am having one stupid propblem with the /bin.mail program:
I am triaying to send one email from one cgi, but when the user to receive the message, the sender is "nobody"!!!

How can I to fix it???
Pelase help me!!

This the code:

open (MEN,$mailtext) || die "No pude abrir el mensaje";
open(MAIL,"| $mailprog $email");  
print MAIL "From: $sender\n";
print MAIL "To: $email\n";
print MAIL "Subject: $subject\n\n";

while (<MEN>){
    print MAIL;
}
close(MAIL);
close(MEN);
0
Comment
Question by:hakimus
2 Comments
 
LVL 16

Accepted Solution

by:
maneshr earned 50 total points
ID: 2745015
nobody is the default user under whom CGI scripts are executed.

if you want to instead use some other user then try this..
$sender="somebody\@somwhere.com";
$mailprog="/usr/bin/sendmail -t ";

open (MEN,$mailtext) || die "No pude abrir el mensaje";
open(MAIL,"| $mailprog") || die $!;

print MAIL "From: $sender\n";
print MAIL "To: $email\n";
print MAIL "Subject: $subject\n\n";

while (<MEN>){
  print MAIL;
}
close(MAIL);
close(MEN);
0
 

Author Comment

by:hakimus
ID: 2745117
Thanbks !!
It's easy!!

The points  are yours!!!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now