Sendmail

  • Thread starter Deepan Perl XML Parser
  • Start date
D

Deepan Perl XML Parser

my $email = populateEmail("test");
print $email;

open(SENDMAIL, "|/usr/lib/sendmail -oi -t -i") or print "cannot open
SENDMAIL: $!";
print SENDMAIL <<"EOF";
From: <deepan\@juniper.net>
To: ${email}
Subject: [SUSTAINING TICKET] Case
Content-type: text/html
testing
EOF
close(SENDMAIL);

The above code results in "No recipient address found in header"
but when i replace ${email} with direct address say deepan.
17\@gmail.com it works fine.

populateEmail function's code is available below:

sub populateEmail {
if(lc($_[0]) eq "test") {
return ("deepan.17\@gmail.com");
}
}

Can anyone spot the bug?
 
D

Deepan Perl XML Parser

Deepan Perl XML Parser wrote:




No. The code is ugly but it works.

which one works for you and which part of the code sounds ugly to you.
I haven't provided you the complete code but still you are able to
tell it ugly. good!
 
X

xhoster

Deepan Perl XML Parser said:
which one works for you

Either way worked for me. (I took the liberty of changing the email
address to point to me rather than you, however.)
and which part of the code sounds ugly to you.

The weird indentation of the close. The bad wrapping. The use of
"\@" when '@' would due instead. The unnecessary use of
brackets in ${email}. I also found the use of non-lexical file
handles somewhat ugly. Some of it is petty stuff, but you did ask.

I haven't provided you the complete code but still you are able to
tell it ugly. good!

You seem to have it backwards. We don't need to see all of the code
to know it is ugly. But we maybe do need to see all of the code to debug
it, if the bug is not in the part of the code you choose to show us.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

sendmail not working - any alternatives? 9
perl and sendmail speed problem 8
sendmail 7
sendmail issue 5
FAQ 9.20 How do I send mail? 3
Mail::Sendmail 5
SendMail Problem 9
Problems with STDIN and POST data 5

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top