Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

whats the problem would be in sending mail?

Status
Not open for further replies.

khoont

Programmer
Mar 9, 2001
10
US
i am running this program
$MGR_LOGIN is my email account khoont@abc.com

==============================
use CGI;
$query= new CGI;
open (MAIL, "| /usr/sbin/sendmail -t -oi $MGR_LOGIN") or &intError( 'Could not open mailer');

print MAIL $query->header;
print MAIL $query->start_html();
print MAIL &quot;<H1>Access Denied</H1>\n&quot;;
print MAIL &quot;<a href=\&quot;#\&quot;>hello</a>&quot;;
print MAIL &quot;<P>You are not allowed access to the requested information</P>\n&quot;;
print MAIL $query->end_html();


close MAIL;
============================

while running this
what i m getting is
====================================
The original message was received at Thu, 26 Apr 2001 12:18:50 -0700 (PDT)
from xxxx.abc.com [xxx.xxx.xx.xxx]

----- The following addresses had permanent fatal errors -----
<khoont@dna-mail2.abc.com>

----- Transcript of session follows -----
delivermail: can't deliver unauthenticated mail


501 <khoont@dna-mail2.abc.com>... Data format error

===============================

what will be the error here.

what i wanted to do is to send html link to get displayed in mail.

thanks in advance
khoont
 
It's probably having trouble with the mail headers. Sendmail expects to see one or more header lines, followed by a blank line. Here's an example:
Code:
print MAIL &quot;From: $from_addr\n&quot;;
print MAIL &quot;To: $to_addr\n&quot;;
print MAIL &quot;Subject: Access Denied\n&quot;;
print MAIL &quot;Content-type: text/html\n&quot;;
print MAIL &quot;\n&quot;;
print MAIL $query->header;
print MAIL $query->start_html(); 
print MAIL &quot;<H1>Access Denied</H1>\n&quot;;
print MAIL &quot;<a href=\&quot;#\&quot;>hello</a>&quot;;
print MAIL &quot;<P>You are not allowed access to the requested information</P>\n&quot;;
print MAIL $query->end_html();
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Hi,
i did tried that but its doesnt look the problem.

anyone have idea how exactly this sendmail works.

i think this is some other problem ..
thanks
Nilesh
 
The mail command I use is &quot;open(MAIL, &quot;| /usr/lib/sendmail -t&quot;). Then I print just like I wrote above, except my sendmail subroutine prints the To: address first. Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top