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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with body_as_string

Status
Not open for further replies.

1234shu

Programmer
Feb 13, 2003
11
US
I got a problem with body_as_string. I'm using Windows 2000 and ActivePerl 5.6. The thing I want to achieve is to send a text file and rtf file as attachment in a email. I followed the example at
First create a email with attachment by using MIME::Lite, then to send the email by using Net::SMTP. But it seems that body_as_string() is causing problems. If I comment this command, it goes to the next step successfully (a new web page). With the command in place, I got an message that there is an problem with page.

Any help will be highly appreciated.

Shu
 
Shu,

What Perl error message(s) are you getting? Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Mike,

Thank you for your reply. I got no Perl error message. After the Perl, a web page is expected. If I use the body_as_string command, the web page after the script is showing message "There is a problem with the page you are trying to read and it cannot be displayed". I'm sure there is no problem with the page. If I comment the body_as_string, it's working perfectly but no attachment is sent out as needed.

Shu
 
Add the following line to the top of your script with the rest of the use()'s
Code:
use CGI::Carp qw(fatalsToBrowser);
This will print out the error messages that you would see if the script were run from the command line. It might tell you why the page can't be displayed.

Additionally, there are some excellent CGI debugging tips in this FAQ: faq452-3023

jaa
 
Thanks Jaa. Use your tip I found the problem. An error in the path to the file I was trying to attach caused the problem.

Your help is very much appreciated.

Shu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top