bilfurd has asked for the wisdom of the Perl Monks concerning the following question:
I created a script that reads information from a database, applies that information to address the e-mail and insert the user's name and password into the text of the message (doing an on-line survey for a client).
The code is very basic and has worked well on two different projects. The problem I have concerns the message text. The URL is hardcoded in the message text. The message text is assigned to a variable. The URL was encoded as
HTTP://www.somesite.com/somepage
but appears in a handful of messages as
HTTP://wwwsomesite.com/somepage
There are no special characters being read from the database.
I have not been able to find any pattern to the occurence.
Have any of you encountered this behavior? Any help understanding this would be appreciated.
Thanks!
=== U P D A T E ===
As requested...
use DBI(); use Mail::Sendmail; unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , '100.100.100.200'; $dbaxs = DBI->connect("DBI:ODBC:dsn=CLIENT_EMAIL") || die "Connection +died\n\n"; $Exe = "SELECT * FROM qryFeedLetter"; $qry = $dbaxs->prepare("$Exe"); $qry->execute() || die "\nBad SQL\n"; while (my $rw = $qry->fetchrow_hashref()) { $login = $rw->{'UsrLogin'}; $FName = $rw->{'UsrFName'}; $Supervisor = $rw->{'Supervisor'}; $EmlTo = $rw->{'UsrEmail'}; $subj = "Employee Satisfaction Survey"; $msg = "Dear $FName:\n\nYou are probably aware .. "; $msg .= ".. more text .. \nNOTE: In your survey, the word \"manage +r\" refers to $Supervisor. .. blah blah blah .. go to http://www.som +esite.com/somepage Your personal \"Log-In\" code is \"$login\". .. +more text here, then .. Thanks.\n\nVery sincerely,\n\nClient"; %mail = ( To => "$EmlTo", From => 'ClientSurvey <soembody@somesite.com>', Bcc => 'me@somesite.com', Subject => "$subj", Message => "$msg" ); sendmail(%mail) || die $Mail::Sendmail::error; print "\n\nLogged:\n", $Mail::Sendmail::log; } $dbaxs->disconnect();
Win XP, Perl v5.8
The text assigned to $msg is significantly longer than posted here
Thanks again
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MAIL::Sendmail Problem
by Paulster2 (Priest) on Nov 07, 2003 at 20:43 UTC | |
by bilfurd (Hermit) on Nov 07, 2003 at 21:08 UTC | |
by menolly (Hermit) on Nov 07, 2003 at 21:58 UTC | |
by bilfurd (Hermit) on Nov 07, 2003 at 22:52 UTC | |
by Paulster2 (Priest) on Nov 08, 2003 at 18:15 UTC | |
|
Re: MAIL::Sendmail Problem
by barrd (Canon) on Nov 07, 2003 at 19:06 UTC |