Re: Sending HTML mail?
On Wed, 9 Oct 2002 20:43:13 +0200, [EMAIL PROTECTED] (Octavian Rasnita) wrote: Hello all, Could you please tell me what module should I use to send HTML mail? Can I use Net::SMTP? And what module could I use to send attachments Here's a nice method for sending text and html at the same time. That way, people without html mail readers can read it also. You could easily add an attachment to this, before the end boundary. ##3 #!/usr/bin/perl use Mail::Sendmail; use strict; my ($boundary,$html_email,$text_email,%email); $boundary = 'qwerqwerqewrqwesdsad' . time; $html_email = qq(html headtitleEmail/title/head body Hello world! /body /html ); $text_email = qq(Hello world!\n); %email = ( To = 'zentara@zentara', From= 'zentara@zentara', Subject = 'Hello world', 'MIME-Version' = 1.0, 'Content-type' = multipart/alternative; boundary=$boundary, Message = qq(--$boundary Content-type: text/plain; charset=UNKNOWN-8BIT $text_email --$boundary Content-type: text/html; charset=iso-8859-1 $html_email --$boundary-- ) ); sendmail(%email); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Weekly list FAQ posting
NAME beginners-faq - FAQ for the beginners-cgi mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address): [EMAIL PROTECTED]. 1.2 - How do I unsubscribe? Now, why would you want to do that? Send mail to [EMAIL PROTECTED], and wait for a response. Once you reply to the response, you'll be unsubscribed. If that doesn't work, find the email address which you are subscribed from and send an email like the following (let's assume your email is [EMAIL PROTECTED]): [EMAIL PROTECTED] 1.3 - There is too much traffic on this list. Is there a digest? Yes. To subscribe to the digest version of this list send an email to: [EMAIL PROTECTED] To unsubscribe from the digest, send an email to: [EMAIL PROTECTED] 1.4 - Is there an archive on the web? Yes, there is. It is located at: http://archive.develooper.com/beginners-cgi%40perl.org/ 1.5 - How can I get this FAQ? This document will be emailed to the list once a month, and will be available online in the archives, and at http://beginners.perl.org/ 1.6 - I don't see something in the FAQ, how can I make a suggestion? Send an email to [EMAIL PROTECTED] with your suggestion. 1.7 - Is there a supporting website for this list? Yes, there is. It is located at: http://beginners.perl.org/ 1.8 - Who owns this list? Who do I complain to? Casey West owns the beginners-cgi list. You can contact him at [EMAIL PROTECTED] 1.9 - Who currently maintains the FAQ? Kevin Meltzer, who can be reached at the email address (for FAQ suggestions only) in question 1.6 1.10 - Who will maintain peace and flow on the list? Casey West, Kevin Meltzer and Ask Bjoern Hansen currently carry large, yet padded, clue-sticks to maintain peace and order on the list. If you are privately emailed by one of these folks for flaming, being off-topic, etc... please listen to what they say. If you see a message sent to the list by one of these people saying that a thread is closed, do not continue to post to the list on that thread! If you do, you will not only meet face to face with a XQJ-37 nuclear powered pansexual roto-plooker, but you may also be taken off of the list. These people simply want to make sure the list stays topical, and above-all, useful to Perl/CGI beginners. 1.11 - When was this FAQ last updated? Sept 07, 2001 2 - Questions about the 'beginners-cgi' list. 2.1 - What is the list for? A list for beginning Perl programmers to ask questions in a friendly atmosphere. The topic of the list is, of course, CGI with Perl. 2.2 - What is this list _not_ for? * SPAM * Homework * Solicitation * Things that aren't Perl related * Non Perl/CGI questions or issues * Lemurs 2.3 - Are there any rules? Yes. As with most communities, there are rules. Not many, and ones that shouldn't need to be mentioned, but they are. * Be nice * No flaming * Have fun 2.4 - What topics are allowed on this list? Basically, if it has to do with Perl/CGI , then it is allowed. If your question has nothing at all to do with Perl/CGI, it will likely be ignored. 2.5 - I want to help, what should I do? Subscribe to the list! If you see a question which you can give an idiomatic and Good answer to, answer away! If you do not know the answer, wait for someone to answer, and learn a little. 2.6 - Is there anything I should keep in mind while answering? We don't want to see 'RTFM'. That isn't very helpful. Instead, guide the beginner to the place in the FM they should R :) 2.7 - I don't want to post a question if it is in an FAQ. Where should I look first? Look in the FAQ! Get acquainted with the 'perldoc' utility, and use it. It can save everyone time if you look in the Perl FAQs first, instead of having a list of people refer you to the Perl FAQs :) You can learn about 'perldoc' by typing: perldoc perldoc At your command prompt. You can also view documentation online at: http://www.perldoc.com and http://www.perl.com 3 - Other Resources 3.1 - What other websites may be useful to a beginner ? * Perl Home Page - http://www.perl.com * PerlMonks - http://www.perlmonks.org * Perldoc - http://www.perldoc.com * Perl Archives - http://www.perlarchives.com 3.2 - What resources may be harmful to a beginner? Beware of Perl4-like code-- You might find some script archives and unauthorized mirrors with old Perl4 versions of Selena Sol and Matt Wright scripts. Don't use those scripts. They are outdated and may even in some cases contain bugs or security problems since many may not have been updated in
Admin by Apache and Nt
Hi, I'm new here and I have just a question I try to run a script from a web page by Apache. This script query the dns file of the dns-server domain.it.dns: open (MYDNS,dns_serv\\C\$\\winnt\\system32\\dns\\mydomain.it.dns ) If I run this script by CMD the script function great, but by CGI it seems not work. It can't find the file or what? I copy the file on my local disk c:\dnsfile.it.dns and it works either with cgi and cmd. Someone have any idea or an interpretation of the fact?? Greetings from Italy... =:)
Mystery number 1 in output
Hi, When the sub (listed below) is called, it generates a 1 within td tags as the first table cell in the table. I am mystified to as why this is happening. I just have td's with labels and form elements. ?? Any ideas, is this a bug? sub display_entry_form { print table( {-border='0', -cellpadding='3', -cellspacing='3', -bgcolor='#bdc6de'}, Tr({align='left', valign='top'}, [ td([ print start_form ( -action = url()) ]), td([ contact name: , textfield ( -name = contact, -override ='1', -value = , -maxlength='40', -size='40', )]), td([ phone number: , textfield ( -name = phone, -override ='1', -value = , -maxlength='20', -size='20', )]), td([ email address: , textfield ( -name = email, -override ='1', -value = , -maxlength='40', -size='40', )]), td([ type: , radio_group ( -name = type, -cols=3, -values = [general, helper, both], -defualt = general, )]), td([ center or group:, textfield ( -name = center_group, -override ='1', -value = , -size='20', -maxlength='20', )]), td([ region: , textfield ( -name=region, -override='1', -value=, -size='20', -maxlength='20', )]), td([ submit (-name=choice, -value=Submit) ]), end_form(), ])); #end table } --www.ramonred.net--
Re: Mystery number 1 in output
--- Ramon Hildreth [EMAIL PROTECTED] wrote: Hi, When the sub (listed below) is called, it generates a 1 within td tags as the first table cell in the table. I am mystified to as why this is happening. I just have td's with labels and form elements. ?? Any ideas, is this a bug? You have a tiny bug in your code. Reformatting to make it easier to read (IMHO): print table( { -border ='0', -cellpadding ='3', -cellspacing ='3', -bgcolor ='#bdc6de' }, Tr( { align = 'left', valign = 'top' }, [ td( [ print start_form ( ... And I'll stop right there because it's your bug. You're printing the return value of a print. print returns a result letting you know if the print succeeded or not. That's what you're printing. Here's a test case: perl -e 'print print Ovid' That prints Ovid1 Cheers, Ovid = Ovid on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//; shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
css in cgi generated page
is there some special trick to linking a style sheet to your page when the page is generated by a cgi script? I have this sub routine that prints the header of a html page: sub write_html_header { print Content-type: text/html\n\nhtml\n head\n; print link rel='stylesheet' href='mystyle.css' /\n; print title$_[0]/title\n; print /head\nbody\n; } When I run this in a browser it displays the page normally except the style sheet isn't applied to the page at all. It just shows the default colors. I also tried it with the attributes type='text/css' and media='screen' but nothing seems to work. I've tried it in Internet Explorer 6.0, Netscape 7.0, Mozilla 1.2a and Opera 6.05. The stylesheet doesn't work in any browser and I've only used simple style attributes, like changing colors and fonts. I don't believe there is anything wrong with the code I have because it works when i link to it from a hardcoded html page, so what happening here? Ian Watt -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]