SPUG: How to use database variable in place of other variable

James Moore james at banshee.com
Thu Mar 14 10:26:39 CST 2002


First off, you're setting $mail{To} to $email - that's dollar sign
email.  You probably want to set it to the contents of the email
variable, so just leave off the ':  To => $email instead of To =>
'$email'.  You could do
To => "$email", but there's no reason to in this case.

     ------------------------------------------------------------
                            James M. Moore
                          james at banshee.com
       Banshee Software: Internet-enabled software development
                    Open Source / .NET / Embedded

-----Original Message-----
From: owner-spug-list at pm.org [mailto:owner-spug-list at pm.org] On Behalf
Of S Bullo
Sent: Thursday, March 14, 2002 8:05 AM
To: Seattle Perl User's Group
Subject: SPUG: How to use database variable in place of other variable

Ok, so the subject makes little sense.
 
I have:
 
%mail = ( To      => '$email',
From    => 'someemail at someplace.com',
Subject => 'Your $row[10] Mailing Information',
Message => "Some message information"
 );
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
 
The script this is in also uses DBI to pull out some variables to
include individual emails.  Normally, in the script I use something
like:
 
my $email = "$row[12]";
 
But this doesn't plug into the $email variable (as the script keeps
failing saying "No recipient").  How do I get the script to recognize
the database variables (which rotate through a whole list)?
 
TIA!
 
Susanne Bullo
Technician - One Site Marketing
 


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org





More information about the spug-list mailing list