Re: email text

2007-04-28 Thread Nigel Peck

Mathew wrote:

I have a script which creates a text file for each of several users.
However, the contents of the file are rarely enough to warrant it.  I'd
much rather place the information inside the email instead of attaching
it as a file.  I haven't been able to find anything to explain how to do
this though.  Although, something tells me I'm completely over-thinking it.

Can someone help?

Mathew


Could you explain a bit more about this? What email? If you're attaching 
it then that must mean you're creating the email so what's stopping you 
putting the text in the body of the message? How are you creating the email?


Cheers,
Nigel


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: email text

2007-04-28 Thread jm

look at Mail::Sender


On 4/28/07, Mathew [EMAIL PROTECTED] wrote:


I have a script which creates a text file for each of several users.
However, the contents of the file are rarely enough to warrant it.  I'd
much rather place the information inside the email instead of attaching
it as a file.  I haven't been able to find anything to explain how to do
this though.  Although, something tells me I'm completely over-thinking
it.

Can someone help?

Mathew

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/






--
since this is a gmail account, please verify the mailing list is included in
the reply to addresses


Re: email text

2007-04-28 Thread Mathew
I'm using MIME::Lite to create the email.  It is being generated as I'm
able to send out all the emails necessary.

The way I'm doing it now is to use a variable which holds a small
message to be inserted into the email.  However, I don't know how to
dynamically format that variable with the data I'm sending.

The data looks like this:

  Ticket IDhh:mm
-
 0000:00
 1111:11
 2222:22

And so on.  That is what gets placed in the file but I'd prefer it be
placed inside the email.

Mathew

Nigel Peck wrote:
 Mathew wrote:
 I have a script which creates a text file for each of several users.
 However, the contents of the file are rarely enough to warrant it.  I'd
 much rather place the information inside the email instead of attaching
 it as a file.  I haven't been able to find anything to explain how to do
 this though.  Although, something tells me I'm completely
 over-thinking it.

 Can someone help?

 Mathew
 
 Could you explain a bit more about this? What email? If you're attaching
 it then that must mean you're creating the email so what's stopping you
 putting the text in the body of the message? How are you creating the
 email?
 
 Cheers,
 Nigel
 
 
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: email text

2007-04-28 Thread Robert Hicks
I typically use a HEREDOC to format my email messages. You can do all 
sort of things by sending the email as HTML of you want as well.


Robert

Mathew wrote:

I'm using MIME::Lite to create the email.  It is being generated as I'm
able to send out all the emails necessary.

The way I'm doing it now is to use a variable which holds a small
message to be inserted into the email.  However, I don't know how to
dynamically format that variable with the data I'm sending.

The data looks like this:

  Ticket IDhh:mm
-
 0000:00
 1111:11
 2222:22

And so on.  That is what gets placed in the file but I'd prefer it be
placed inside the email.

Mathew


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: email text

2007-04-28 Thread Mathew
I'll have to look at the HEREDOC option.  I'm not familiar with that.
As for HTML, people here get quite frisky when they don't get plain text
emails.

Mathew

Robert Hicks wrote:
 I typically use a HEREDOC to format my email messages. You can do all
 sort of things by sending the email as HTML of you want as well.
 
 Robert
 
 Mathew wrote:
 I'm using MIME::Lite to create the email.  It is being generated as I'm
 able to send out all the emails necessary.

 The way I'm doing it now is to use a variable which holds a small
 message to be inserted into the email.  However, I don't know how to
 dynamically format that variable with the data I'm sending.

 The data looks like this:

   Ticket IDhh:mm
 -
  0000:00
  1111:11
  2222:22

 And so on.  That is what gets placed in the file but I'd prefer it be
 placed inside the email.

 Mathew
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: email text

2007-04-28 Thread Robert Hicks

my $BODY = END_TXT;
This is the message that will be passed and you
can even put $variables into it and they will
be interpolated.
END_TXT

Then you just pass $BODY to however you constructed your MIME::Lite call.

HTH,

Robert

Mathew wrote:

I'll have to look at the HEREDOC option.  I'm not familiar with that.
As for HTML, people here get quite frisky when they don't get plain text
emails.

Mathew

Robert Hicks wrote:

I typically use a HEREDOC to format my email messages. You can do all
sort of things by sending the email as HTML of you want as well.

Robert

Mathew wrote:

I'm using MIME::Lite to create the email.  It is being generated as I'm
able to send out all the emails necessary.

The way I'm doing it now is to use a variable which holds a small
message to be inserted into the email.  However, I don't know how to
dynamically format that variable with the data I'm sending.

The data looks like this:

  Ticket IDhh:mm
-
 0000:00
 1111:11
 2222:22

And so on.  That is what gets placed in the file but I'd prefer it be
placed inside the email.

Mathew


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Email text encoding

2004-02-12 Thread Owen
On Wed, 11 Feb 2004 15:21:24 -0600
Camilo Gonzalez [EMAIL PROTECTED] wrote:

 
 Eek! I've been told by my ISP that my Perl script to email myself and 
 the user of my form the contents on my contact form has been hijacked by 
 a spammer. My ISP has been deluged by recipients with complaints. Where 
 have I gone wrong? Please be kind, this is a beginners' list after all.

I am not alltogether certain what you are doing, but I suggest you look at 
http://www.gunnar.cc/cgi-bin/contact.pl and then download the latest version of 
CGI::ContactForm

It is a pure perl module so can be installed in your own directory.

It probably meets all your concerns


-- 
Owen


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Email text encoding

2004-02-11 Thread Thomas Bätzler
Hi,

Jan Eden [EMAIL PROTECTED] wrote:
 and thanks for all the previous suggestions regarding email 
 modules. Now it turned out that my ISP refuses to let me 
 install *any* additional Perl module on the server, so I have 
 to use sendmail.

Well, I'm sure he won't let you install a module in the global
module search path. But if you can upload files to your CGI
directory, you can use any pure Perl module, too.
Just upload the module in the proper subdiretory structure on
the server and then use a use lib statement in your code to
point your CGI program to the proper search path.

HTH,
Thomas


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Email text encoding

2004-02-11 Thread Wiggins d Anconia
 Hi,
 
 and thanks for all the previous suggestions regarding email modules.
Now it turned out that my ISP refuses to let me install *any* additional
Perl module on the server, so I have to use sendmail.
 

Switch ISPs?  Sorry this isn't the answer you want.  Sorry I can't
provide more help with respect to your encoding issues, but e-mail
itself is incredibly complex and personally I would run for the hills
(read: find a new ISP) before messing with it directly anymore,
*especially* when doing the type of things you are talking about.

 Is there anything I can do about this? How do I correctly encode 8-bit
characters when I do not have access to a module?
 

Have you read:

perldoc utf8
perldoc perlunicode

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Email text encoding

2004-02-11 Thread Camilo Gonzalez
Eek! I've been told by my ISP that my Perl script to email myself and 
the user of my form the contents on my contact form has been hijacked by 
a spammer. My ISP has been deluged by recipients with complaints. Where 
have I gone wrong? Please be kind, this is a beginners' list after all.

#!/usr/local/bin/perl -wT
use CGI::Carp qw(fatalsToBrowser);
use strict;
use CGI;
my $cgiobj = new CGI;
$ENV{PATH} = ;
#Get parameters
my $name = $cgiobj-param('name');
my $address = $cgiobj-param('address');
my $email = $cgiobj-param('email');
my $comments = $cgiobj-param('comments');
#send emails to Camilo and sender
my $from ='Opensourceman';
my $subject = 'Contact Confirmation from Opensourceman';
my $reply = '[EMAIL PROTECTED]';
my $sendmail = '/usr/lib/sendmail -i -t';
open (SENDMAIL, |$sendmail) or die Cannot open sendmail: $!;
print SENDMAIL To: $email, $reply\n;
print SENDMAIL From: $from\n;
print SENDMAIL Reply-to: $reply\n;
print SENDMAIL Subject: $subject;
print SENDMAIL \n\n;
print SENDMAIL Thanks for contacting Opensourceman. Below is what you 
submitted to us:\n
   Name: $name\n
   Address: $address\n
   Email: $email\n
   Comments: $comments \n\n 
   We will be contacting you shortly;
close(SENDMAIL);

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Email text encoding

2004-02-11 Thread Bob Showalter
Camilo Gonzalez wrote:
 Eek! I've been told by my ISP that my Perl script to email myself and
 the user of my form the contents on my contact form has been hijacked
 by a spammer. My ISP has been deluged by recipients with complaints.
 Where have I gone wrong? Please be kind, this is a beginners' list
 after all. 

 ...
 my $email = $cgiobj-param('email');
 ...
 print SENDMAIL To: $email, $reply\n;

Hint: $email could contain more than just an email address. Think about
it...

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Email text encoding

2004-02-11 Thread Brad Lhotsky
Basically, you're allowing a user to specificy an email address as a
recipient.  There's no reason for that person to get a copy of the
message.  Redirect to a thank you for message! It has been delivered
page.  I'm not sure but there might be a way to abuse your pipe to
sendmail.  I'd strip out any non word/digit/punctuation from comments as
a safety.  Also, tell your ISP to install a Mail::* module.  I don't
like giving a pipe to sendmail over CGI.  Sendmail is riddled with
horrid security problems, and giving a user the ability to send
malicious data to sendmail client isn't something I'd recommend.

You're re-inventing the wheel, and in this case, its dangerous, try:
http://search.cpan.org/~markov/MailTools-1.60/
http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/

I'd recommend MailTools primarily as its in the Top 10 of the Phalanx
100.  Mail::Sendmail is Tier 3.

See: http://qa.perl.org/phalanx/distros.html

These modules are heavily audited and trustworthy.  Since you have your
ISPs ear at the moment with the abuse complaints, this would be a
perfect opportunity to go Install MailTools, its an important step to
keeping this from happening again.


On Wed, Feb 11, 2004 at 03:21:24PM -0600, Camilo Gonzalez wrote:
 
 Eek! I've been told by my ISP that my Perl script to email myself and 
 the user of my form the contents on my contact form has been hijacked by 
 a spammer. My ISP has been deluged by recipients with complaints. Where 
 have I gone wrong? Please be kind, this is a beginners' list after all.
 
 #!/usr/local/bin/perl -wT
 use CGI::Carp qw(fatalsToBrowser);
 use strict;
 use CGI;
 my $cgiobj = new CGI;
 $ENV{PATH} = ;
 
 #Get parameters
 my $name = $cgiobj-param('name');
 my $address = $cgiobj-param('address');
 my $email = $cgiobj-param('email');
 my $comments = $cgiobj-param('comments');
 
 #send emails to Camilo and sender
 my $from ='Opensourceman';
 my $subject = 'Contact Confirmation from Opensourceman';
 my $reply = '[EMAIL PROTECTED]';
 my $sendmail = '/usr/lib/sendmail -i -t';
 open (SENDMAIL, |$sendmail) or die Cannot open sendmail: $!;
 print SENDMAIL To: $email, $reply\n;
 print SENDMAIL From: $from\n;
 print SENDMAIL Reply-to: $reply\n;
 print SENDMAIL Subject: $subject;
 print SENDMAIL \n\n;
 print SENDMAIL Thanks for contacting Opensourceman. Below is what you 
 submitted to us:\n
Name: $name\n
Address: $address\n
Email: $email\n
Comments: $comments \n\n 
We will be contacting you shortly;
 close(SENDMAIL);
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 
 

-- 
Brad Lhotsky [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Email text encoding

2004-02-11 Thread Brad Lhotsky
Forgot to CC the group:

Including:

$email = [EMAIL PROTECTED]: LONG LIST OF EMAILS\r\nSubject:
PILLS\r\n\r\nEMAIL CONTENT\r\n\r\n.\r\n$ENDOFFILE;


On Wed, Feb 11, 2004 at 04:28:12PM -0500, Bob Showalter wrote:
 Camilo Gonzalez wrote:
  Eek! I've been told by my ISP that my Perl script to email myself and
  the user of my form the contents on my contact form has been hijacked
  by a spammer. My ISP has been deluged by recipients with complaints.
  Where have I gone wrong? Please be kind, this is a beginners' list
  after all. 
 
  ...
  my $email = $cgiobj-param('email');
  ...
  print SENDMAIL To: $email, $reply\n;
 
 Hint: $email could contain more than just an email address. Think about
 it...
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 
 

-- 
Brad Lhotsky [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Email text encoding

2004-02-11 Thread Jan Eden
Hi Thomas,

Thomas Bätzler wrote:

Hi,

Jan Eden [EMAIL PROTECTED] wrote:
 and thanks for all the previous suggestions regarding email 
 modules. Now it turned out that my ISP refuses to let me 
 install *any* additional Perl module on the server, so I have 
 to use sendmail.

Well, I'm sure he won't let you install a module in the global
module search path. But if you can upload files to your CGI
directory, you can use any pure Perl module, too.
Just upload the module in the proper subdiretory structure on
the server and then use a use lib statement in your code to
point your CGI program to the proper search path.

I thought about this, but until now I have always installed modules from CPAN using 
the Makefile.PL / make / make test / make install routine. I am not sure which files 
of a given module I have to copy to a server and at which point of the installation 
process all of these files are available.

I will read perlmod and try to go this way.

Thank you,

Jan
-- 
Hanlon's Razor: Never attribute to malice that which can be adequately explained by 
stupidity.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Email text encoding

2004-02-11 Thread Jan Eden

Wiggins d Anconia wrote:

Hi,

and thanks for all the previous suggestions regarding email modules.
Now it turned out that my ISP refuses to let me install *any*
additional Perl module on the server, so I have to use sendmail.


Switch ISPs?  Sorry this isn't the answer you want.  Sorry I can't
provide more help with respect to your encoding issues, but e-mail
itself is incredibly complex and personally I would run for the
hills (read: find a new ISP) before messing with it directly
anymore, *especially* when doing the type of things you are talking
about.

Apart from this issue, I am relatively happy with my ISP, so I tend to wait a little 
bit.

Is there anything I can do about this? How do I correctly encode
8-bit characters when I do not have access to a module?


Have you read:

perldoc utf8 perldoc perlunicode

I will now.

Thank you,

Ja
-- 
Hanlon's Razor: Never attribute to malice that which can be adequately explained by 
stupidity.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response