473,471 Members | 2,613 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Sendmail problem

jim

Hello,

I am having a problem w/SendMail reporting: " No recipient addresses
found in header".

Funny thing is though, I properly recieve the email message.

Thanks for your help.

-jim

Here is the code:
sub my_send_mail
{
local($fromuser, $touser, $subject, $messagebody) = @_;

local($old_path) = $ENV{"PATH"};
$ENV{"PATH"} = "";
$ENV{ENV} = "";

open(SENDMAIL, "| /bin/sendmail -t -n") || &web_error ("Unable to open
sendmail");

$ENV{"PATH"} = $old_path;

print SENDMAIL "To: $touser\n";
print SENDMAIL "From: $fromuser\n";
print SENDMAIL "Subject: $subject\n\n";
print SENDMAIL "$messagebody\n";
close(SENDMAIL);

}
Jul 19 '05 #1
4 4001
jim <defenderjim4@no__spam__juno.com> wrote in message news:<D0****************@nwrddc01.gnilink.net>...
I am having a problem w/SendMail
So why are you posting to a (non-existant) newsgroup that is (or
rather would be if it existed) about Perl?
Here is the code:
That looks like it was written for Perl4. If it _was_ written for
Perl4 that's OK. But if this was written recently it implies the
author needs to update his Perl skills.

sub my_send_mail
{
local($fromuser, $touser, $subject, $messagebody) = @_;
Do not use local() where you want my() unless you need your code to
run on Perl4. (You really should _not_ still be using Perl4).
local($old_path) = $ENV{"PATH"};
$ENV{"PATH"} = "";
No! That's one place where you could use local!

local $ENV{PATH} = '';
$ENV{ENV} = "";

open(SENDMAIL, "| /bin/sendmail -t -n") || &web_error ("Unable to open
sendmail");
The there's another switch that is almost alwats used with 'sendmail
-t' to disable dot handling (can't recall what it is). Why have you
omitted it?

Why is that & there?

Why don't you include the error in your error message?
$ENV{"PATH"} = $old_path;


You wouldn't need this if you'd used local.
Jul 19 '05 #2
jim
Hey nobull,

Thanks for your reply.

The short story is I got it working. There was something in the body of
the message that it didnt like.

The long response follows:

So why are you posting to a (non-existant) newsgroup that is (or Well, if it is non-existent, then why are all these messages here?
That looks like it was written for Perl4. If it _was_ written for Yeah, I think so. It is legacy code written by someone else and I have
had to work with it.
Perl4 that's OK. Yeah, I think so, dont know the original author or history.
Do not use local() where you want my() unless you need your code to No, does not need to run on perl4, changed above to my;

Note delimeter at end of previous sentance: I think I have been
programming too long when I end my sentences w/a semi colon.

Why have you omitted it? Haven't, just trying to get someone else's code working.
Why don't you include the error in your error message?

Hhhmmm good point. Must have been late/tired.

Jul 19 '05 #3
jim <m4@no_spam_juno.com> wrote in message news:<z%****************@nwrddc02.gnilink.net>...
So why are you posting to a (non-existant) newsgroup that is (or

Well, if it is non-existent, then why are all these messages here?


Ignorance, incompetance and compassion.

For details, please see numerous previous theads.
Jul 19 '05 #4
jim <m4@no_spam_juno.com> wrote in message news:<z%****************@nwrddc02.gnilink.net>...
The short story is I got it working. There was something in the body of
the message that it didnt like.


A line starting with a dot perhaps?

[ Re the swich to disable special treament for lines starting with a dot.. ]
Why have you omitted it?

Haven't, just trying to get someone else's code working.


Have you tried adding it?
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: lawrence | last post by:
We're installing a new server at the office and this will be the first server we set up from which we host our website. We got tired of dealing with Interland and decided to bring our hosting...
2
by: Babaloo | last post by:
Hello, I am having a problem with PHP 4.2.2 and RH 8. PHP is working fine except email. I have a test script to send mail, I have sendmail_path = '/usr/lib/sendmail -t -i' set in php.ini,...
6
by: Sumith Bandula | last post by:
Hi all, I am using a simple php script to send a mail. <?php if (mail($to, $sub, $message, $from)) echo "sent mail successfully<br>\n"; ?> It GOES $to = "me@localhost.localdomain"
0
by: Aaron Powell | last post by:
I am writing a program for a study I am doing where I must contact several different organisations stored in a database I compiled, but I need to send each email one at a time so they don't know...
2
by: mike | last post by:
I've spent a couple of days on this and I'm to the "bang-my-head 'gainst the monitor and babble in tongues" mode. First - SuSE Pro 9.3, Linux 2.6.11.4-21.7, Apache 2.0.53, PHP 4.3.10 I have...
1
by: James Robertson | last post by:
Issue is that I really do not know diddly. Copying and trying to learn as much as I can about VB and ASP2.0. Now the question I have is I created an E-Mail form the sendmail properties in the VB...
3
by: swangdb | last post by:
I have a Sun Server running Solaris 10 and Sendmail 8.13.7. I have Majordomo and Listproc installed on this server and they work. I have several production majordomo and listproc mailing lists...
4
by: Nilesh | last post by:
I have a server in which sendmail gives problem. How do i change php.ini so that i can use exim for mail() System is FC-6.
4
by: Clodoaldo | last post by:
I need to know if an email was refused for whatever reason, it makes no difference. The email is sent to an email address that does not exist in a foreign domain. I can see in the postfix log...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.