Discussion:
Sending HTML email on command line
(too old to reply)
Daniel deHam
2005-08-05 17:38:48 UTC
Permalink
Hi,

I'm trying to send an html email on the command line, but the command
fails because there are quotes in the html. How can I send an html
message using the command line? Below is my perl script, and below
that is the output.

Thanks,

Dan

#!C:/perl/bin/perl.exe -w
use strict;
use Win32::OLE;
use CGI qw(:standard);

print header;

my $errors;
my $body = "<html>\n";
$body .= "<head>\n";
$body .= "<title>Untitled Document</title>\n";
$body .= "<meta http-equiv=\"Content-Type\" content=\"text/html;
charset=iso-8859-1\">\n";
$body .= "</head>\n";
$body .= "\n";
$body .= "<body>\n";
$body .= "<table width=\"100%\" border=\"0\">\n";
$body .= " <tr>\n";
$body .= " <td width=\"43%\"><strong>Ground Control Full Order
</strong></td>\n";
$body .= " <td width=\"57%\">&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Customer\'s NEW GCNumber:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Partner Number:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Partner\'s GC Number:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Where Purchased:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Installer Full Name:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Installer Phone: </td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Customer\'s GC Account Number:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Customer Type:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Type of Direcway Service:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Direcway Modem Type:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td colspan=\"2\"><hr></td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td><strong>Verify this information in Netsuite:
</strong></td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Status:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Company Name:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Category:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Sales Rep:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Phone:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Alt Phone:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Fax:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>EMail:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Partner:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Lead Source:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Start Date:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Partner Account: </td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Paid by Parent:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping Attention:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping Addressee:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping Phone:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping Address1:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping Address2:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping City:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping State:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping Zip:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Shipping Country:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing Attention:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing Addressee:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing Phone:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing Address1:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing Address2:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing City:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing State:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing Country:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Terms:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Price Level:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Billing Company Name:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Credit Card Number: </td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Expiration Date:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Cardholder Name:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Credit Card Type:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Transponder:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>System:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Dish Size:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Public IP:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Numberof IPs:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Bandwidth Subscription:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Bandwidth Cost:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td colspan=\"2\"><hr></td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td><strong>Enter this information into
Netsuite:</strong></td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Installation Requested:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Commissioned:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Service Plan:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Equipment &amp; Install:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Satellite:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Address:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Is Taxable:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Tax State:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>Bandwidth Order: Bandwidth:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>IP Qty:</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " <td>&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= "</table>\n";
$body .= "</body>\n";
$body .= "</html>\n";
$body .= "\n";

my $to_address = '***@groundcontrol.com';
my $subject = "Full Order Error Occurred";


#email Dan
if (MySendMail($to_address,$subject,$body) == 1)
{
printf("Mail sent correctly.");
}
else
{
printf("There was an error sending mail.\n");
printf("%s",$body);
}


#*********************************************************************
************
#================== [ MySendMail ]
# input parameters are to_address, subject, and body
# It returns 1 if it succeeds, 0 if it fails
sub MySendMail
{
my @params = @_;
my $to_param = $params[0];
my $subject_param = $params[1];
my $body_param .= $params[2];
my $ReturnVal = 0;


# declare the variables we are going to use
my ($to, $f, $subject, $body, $server, $hostname, $u, $pw, $debug,
$x, $return);

# you must change the values marked with
# populate all the variables we are going to use
$to = "-to " . $to_param;
$f = "-f autosupport\@groundcontrol.com";
$subject = "-subject \"". $subject_param . "\"";
$body = "-body \"". $body_param ."\"";
$server = "-server 67.130.139.34";
$hostname = "-hostname secure.groundcontrol.com";
# $u = "-u d.deham\@groundcontrol.com";
# $pw = "-pw !";
# $debug = "-debug";
#$x = "-x \"X-Custom-header: Check it out!\"";

# Here is where we run Blat.
# Note, the Perl vars are the same as Blat's paramaters.
# All the stuff you see Blat return to STDOUT (non error messages
to
# the screen) get put in the $return variable.
# $return = `blat - $to $f $subject $body $server $hostname $u $pw
$debug $x`;
$return = `blat - $to $f $subject $body $server $hostname -noh -
html`;
#return holds the result from the server
if (($return =~ m/Subject:/g) && (!($return =~ m/Error:/g)) )
{
$ReturnVal = 1;
}
else
{
$ReturnVal = 0;
$errors .= "mailer error: " . $return . "\n";
$errors .= "email body:" . $body_param . "\n";
}
#print $return;
return $ReturnVal;
}# end: sub MySendMail

*****************************************************
OUTPUT
*****************************************************
D:\cgi-bin\test>perl html-email.pl
Content-Type: text/html; charset=ISO-8859-1

There was an error sending mail.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-
1">
</head>

<body>
<table width="100%" border="0">
<tr>
<td width="43%"><strong>Ground Control Full Order </strong></td>
<td width="57%">&nbsp;</td>
</tr>
<tr>
<td>Customer's NEW GCNumber:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Partner Number:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Partner's GC Number:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Where Purchased:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Installer Full Name:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Installer Phone: </td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Customer's GC Account Number:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Customer Type:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Type of Direcway Service:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Direcway Modem Type:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td><strong>Verify this information in Netsuite: </strong></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Status:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Company Name:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Category:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Sales Rep:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Phone:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Alt Phone:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Fax:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>EMail:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Partner:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Lead Source:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Start Date:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Partner Account: </td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Paid by Parent:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping Attention:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping Addressee:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping Phone:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping Address1:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping Address2:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping City:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping State:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping Zip:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Shipping Country:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing Attention:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing Addressee:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing Phone:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing Address1:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing Address2:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing City:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing State:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing Country:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Terms:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Price Level:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Billing Company Name:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Credit Card Number: </td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Expiration Date:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Cardholder Name:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Credit Card Type:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Transponder:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>System:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Dish Size:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Public IP:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Numberof IPs:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Bandwidth Subscription:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Bandwidth Cost:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td><strong>Enter this information into Netsuite:</strong></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Installation Requested:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Commissioned:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Service Plan:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Equipment &amp; Install:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Satellite:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Address:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Is Taxable:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Tax State:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Bandwidth Order: Bandwidth:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>IP Qty:</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>


D:\cgi-bin\test>






------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h54fm9v/M=362131.6882499.7825260.1510227/D=groups/S=1705007389:TM/Y=YAHOO/EXP=1123276165/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->
--
Homepage:
http://www.blat.net

Community email addresses:
Post message: ***@yahoogroups.com
Subscribe: blat-***@yahoogroups.com
Unsubscribe: blat-***@yahoogroups.com
List owner: blat-***@yahoogroups.com

Shortcut URL to this page:
http://groups.yahoo.com/group/blat
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/blat/

<*> To unsubscribe from this group, send an email to:
blat-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Chip
2005-08-06 17:28:13 UTC
Permalink
Post by Daniel deHam
Hi,
I'm trying to send an html email on the command line, but the command
fails because there are quotes in the html. How can I send an html
message using the command line? Below is my perl script, and below
that is the output.
Thanks,
Dan
Anywhere that you have quotation marks within your html, you need to preceed
it with a backslash (\). Blat is written in C, and the command line parser
uses quotation marks to allow spaces within an argument. To tell teh parser
to leave your html quotation marks alone, you need the backslash.

Chip



------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hb4nqih/M=362131.6882499.7825260.1510227/D=groups/S=1705007389:TM/Y=YAHOO/EXP=1123356774/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->
--
Homepage:
http://www.blat.net
Dan deHam
2005-08-08 22:05:02 UTC
Permalink
That helped, but i'm still having a problem sending email. The problem now
is the % sign. How do I escape %? I tried \% and %% but neither of those
worked. My email sends fine when I remove the %. Please help!

Thanks,

Daniel

Here's my source code:
****************************************************
****************************************************
#!C:/perl/bin/perl.exe -w
# postdata.pl
use strict;
use Win32::OLE;
use CGI qw(:standard);

print header;

my $errors;
my $body = "<html>\n";
$body .= "<head>\n";
$body .= "<title>Untitled Document</title>\n";
$body .= "<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;
charset=iso-8859-1\\\">\n";
$body .= "</head>\n";
$body .= "\n";
$body .= "<body>\n";
$body .= "<table width=\\\"100%\\\" border=\\\"0\\\">\n";
$body .= " <tr>\n";
$body .= " <td width=\\\"43%\\\"><strong>Ground Control Full Order
</strong></td>\n";
$body .= " <td width=\\\"57%\\\">&nbsp;</td>\n";
$body .= " </tr>\n";
$body .= " <tr>\n";

my $to_address = '***@groundcontrol.com';
my $subject = "Full Order";


#email Dan
if (MySendMail($to_address,$subject,$body) == 1)
{
printf("Mail sent correctly.");
}
else
{
printf("There was an error sending mail.\n");
#printf("%s",$body);
print $errors;
}


#*********************************************************************************
#================== [ MySendMail ]
# input parameters are to_address, subject, and body
# It returns 1 if it succeeds, 0 if it fails
sub MySendMail
{
my @params = @_;
my $to_param = $params[0];
my $subject_param = $params[1];
my $body_param .= $params[2];
my $ReturnVal = 0;


# declare the variables we are going to use
my ($to, $f, $subject, $body, $server, $hostname, $u, $pw, $debug, $x,
$return);

# you must change the values marked with
# populate all the variables we are going to use
$to = "-to " . $to_param;
$f = "-f from\@groundcontrol.com";
$subject = "-subject \"". $subject_param . "\"";
$body = "-body \"". $body_param ."\"";
$server = "-server XX.XX.XX.XX";
$hostname = "-hostname host.com";
# $u = "-u d.deham\@groundcontrol.com";
# $pw = "-pw !";
# $debug = "-debug";
#$x = "-x \"X-Custom-header: Check it out!\"";

# Here is where we run Blat.
# Note, the Perl vars are the same as Blat's paramaters.
# All the stuff you see Blat return to STDOUT (non error messages to
# the screen) get put in the $return variable.
# $return = `blat - $to $f $subject $body $server $hostname $u $pw
$debug $x`;
$return = `blat - $to $f $subject $body $server $hostname -noh -html`;
#return holds the result from the server
if (($return =~ m/Subject:/g) && (!($return =~ m/Error:/g)) )
{
$ReturnVal = 1;
}
else
{
$ReturnVal = 0;
$errors .= "mailer error: " . $return . "\n";
$errors .= "email body:" . $body_param . "\n";
}
#print $return;
return $ReturnVal;
}# end: sub MySendMail

Here's the output:
****************************************************
****************************************************
D:\cgi-bin\test>perl html-email.pl
Content-Type: text/html; charset=ISO-8859-1

There was an error sending mail.
mailer error: Blat v2.4 w/GSS encryption (build : Jan 15 2005 08:32:11)

Failed to open registry key for Blat
To set the SMTP server's address and the user name at that address do:
blat -install server username
or use '-server <server name>' and '-f <user name>'
aborting, nothing sent

email body:<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>

<body>
<table width=\"100%\" border=\"0\">
<tr>
<td width=\"43%\"><strong>Ground Control Full Order </strong></td>
<td width=\"57%\">&nbsp;</td>
</tr>
<tr>


D:\cgi-bin\test>
Post by Chip
Post by Daniel deHam
Hi,
I'm trying to send an html email on the command line, but the command
fails because there are quotes in the html. How can I send an html
message using the command line? Below is my perl script, and below
that is the output.
Thanks,
Dan
Anywhere that you have quotation marks within your html, you need to preceed
it with a backslash (\). Blat is written in C, and the command line parser
uses quotation marks to allow spaces within an argument. To tell teh parser
to leave your html quotation marks alone, you need the backslash.
Chip
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12ht26hr8/M=362329.6886308.7839368.1510227/D=groups/S=1705007389:TM/Y=YAHOO/EXP=1123545905/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
--
Homepage:
http://www.blat.net
namtog
2005-08-08 22:30:54 UTC
Permalink
Greetings Daniel,

You wrote; "That helped, but I'm still having
a problem sending email. The problem now is
the % sign. How do I escape %? I tried \% and
%% but neither of those worked. My email sends
fine when I remove the %. Please help!

You shouldn't really need to.
Common escape sequences :
\a Beep
\b Backspace
\c "Control" caracter. \cD = CTRL-D
\e Escape
\f Form feed
\l Make the next letter lowercase
\n New line, return.
\r Carriage return.
\t Tab.
\u Make the next letter uppercase
\x Enables hex numbers
\v Vertical tab
\\ Print backslash
\" Print double quotes
\ Escape next character if known otherwise print. Also allows octal
numbers.
\L Make all letters lowercase until the \E
\U Make all letters uppercase until the \E
\Q Add a backslash-quote to all the nonalphanumerics until the \E
\E Terminates the effects of \L, \U, or \Q

escape @ or $ or "

The only time you need to escape % is when you are
writing it to another file. The use your first
technique, \%. So this;
<td width=\"43%\"><strong>Ground Control Full Order </strong></td>
would change to this;
<td width=\"43\%\"><strong>Ground Control Full Order </strong></td>


Are you sure this is the problem?

Namtog




------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12ha3annc/M=362329.6886308.7839368.1510227/D=groups/S=1705007389:TM/Y=YAHOO/EXP=1123547455/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
--
Homepage:
http://www.blat.net
Dan deHam
2005-08-08 22:36:09 UTC
Permalink
Tim Musson
2005-08-09 19:19:15 UTC
Permalink
Hey Daniel,

wow, that is a lot of html in your perl code...
Try using the ' instead of the " char (same key on the keyboard).

Is there any reason you are including all that html code in your perl
code instead of putting it in a file, and reading it in?

You could also use "here documents" to send to Blat like this.
print HTMLout <<End;
<html>
<head> <Title>GroupWise Post Office Statistics</TITLE> </head>
<body>
End

Dd> I'm trying to send an html email on the command line, but the command
Dd> fails because there are quotes in the html. How can I send an html
Dd> message using the command line? Below is my perl script, and below
Dd> that is the output.

Dd> Thanks,

Dd> Dan

Dd> #!C:/perl/bin/perl.exe -w
Dd> use strict;
Dd> use Win32::OLE;
Dd> use CGI qw(:standard);

Dd> print header;

Dd> my $errors;
Dd> my $body = "<html>\n";
Dd> $body .= "<head>\n";
Dd> $body .= "<title>Untitled Document</title>\n";
Dd> $body .= "<meta http-equiv=\"Content-Type\" content=\"text/html;
Dd> charset=iso-8859-1\">\n";
Dd> $body .= "</head>\n";
Dd> $body .= "\n";
Dd> $body .= "<body>\n";
Dd> $body .= "<table width=\"100%\" border=\"0\">\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td width=\"43%\"><strong>Ground Control Full Order
Dd> </strong></td>\n";
Dd> $body .= " <td width=\"57%\">&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Customer\'s NEW GCNumber:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Partner Number:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Partner\'s GC Number:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Where Purchased:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Installer Full Name:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Installer Phone: </td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Customer\'s GC Account Number:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Customer Type:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Type of Direcway Service:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Direcway Modem Type:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td colspan=\"2\"><hr></td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td><strong>Verify this information in Netsuite:
Dd> </strong></td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Status:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Company Name:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Category:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Sales Rep:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Phone:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Alt Phone:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Fax:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>EMail:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Partner:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Lead Source:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Start Date:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Partner Account: </td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Paid by Parent:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping Attention:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping Addressee:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping Phone:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping Address1:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping Address2:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping City:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping State:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping Zip:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Shipping Country:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing Attention:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing Addressee:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing Phone:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing Address1:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing Address2:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing City:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing State:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing Country:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Terms:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Price Level:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Billing Company Name:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Credit Card Number: </td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Expiration Date:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Cardholder Name:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Credit Card Type:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Transponder:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>System:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Dish Size:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Public IP:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Numberof IPs:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Bandwidth Subscription:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Bandwidth Cost:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td colspan=\"2\"><hr></td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td><strong>Enter this information into
Dd> Netsuite:</strong></td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Installation Requested:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Commissioned:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Service Plan:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Equipment &amp; Install:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Satellite:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Address:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Is Taxable:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Tax State:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>Bandwidth Order: Bandwidth:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>IP Qty:</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= " <tr>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " <td>&nbsp;</td>\n";
Dd> $body .= " </tr>\n";
Dd> $body .= "</table>\n";
Dd> $body .= "</body>\n";
Dd> $body .= "</html>\n";
Dd> $body .= "\n";

Dd> my $to_address = '***@groundcontrol.com';
Dd> my $subject = "Full Order Error Occurred";


Dd> #email Dan
Dd> if (MySendMail($to_address,$subject,$body) == 1)
Dd> {
Dd> printf("Mail sent correctly.");
Dd> }
Dd> else
Dd> {
Dd> printf("There was an error sending mail.\n");
Dd> printf("%s",$body);
Dd> }


Dd> #*********************************************************************
Dd> ************
Dd> #================== [ MySendMail ]
Dd> # input parameters are to_address, subject, and body
Dd> # It returns 1 if it succeeds, 0 if it fails
Dd> sub MySendMail
Dd> {
Dd> my @params = @_;
Dd> my $to_param = $params[0];
Dd> my $subject_param = $params[1];
Dd> my $body_param .= $params[2];
Dd> my $ReturnVal = 0;


Dd> # declare the variables we are going to use
Dd> my ($to, $f, $subject, $body, $server, $hostname, $u, $pw, $debug,
Dd> $x, $return);

Dd> # you must change the values marked with
Dd> # populate all the variables we are going to use
Dd> $to = "-to " . $to_param;
Dd> $f = "-f autosupport\@groundcontrol.com";
Dd> $subject = "-subject \"". $subject_param . "\"";
Dd> $body = "-body \"". $body_param ."\"";
Dd> $server = "-server 67.130.139.34";
Dd> $hostname = "-hostname secure.groundcontrol.com";
Dd> # $u = "-u d.deham\@groundcontrol.com";
Dd> # $pw = "-pw !";
Dd> # $debug = "-debug";
Dd> #$x = "-x \"X-Custom-header: Check it out!\"";

Dd> # Here is where we run Blat.
Dd> # Note, the Perl vars are the same as Blat's paramaters.
Dd> # All the stuff you see Blat return to STDOUT (non error messages
Dd> to
Dd> # the screen) get put in the $return variable.
Dd> # $return = `blat - $to $f $subject $body $server $hostname $u $pw
Dd> $debug $x`;
Dd> $return = `blat - $to $f $subject $body $server $hostname -noh -
Dd> html`;
Dd> #return holds the result from the server
Dd> if (($return =~ m/Subject:/g) && (!($return =~ m/Error:/g)) )
Dd> {
Dd> $ReturnVal = 1;
Dd> }
Dd> else
Dd> {
Dd> $ReturnVal = 0;
Dd> $errors .= "mailer error: " . $return . "\n";
Dd> $errors .= "email body:" . $body_param . "\n";
Dd> }
Dd> #print $return;
Dd> return $ReturnVal;
Dd> }# end: sub MySendMail

Dd> *****************************************************
Dd> OUTPUT
Dd> *****************************************************
D:\cgi-bin\test>>perl html-email.pl
Dd> Content-Type: text/html; charset=ISO-8859-1

Dd> There was an error sending mail.
Dd> <html>
Dd> <head>
Dd> <title>Untitled Document</title>
Dd> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-
1">>
Dd> </head>

Dd> <body>
Dd> <table width="100%" border="0">
Dd> <tr>
Dd> <td width="43%"><strong>Ground Control Full Order </strong></td>
Dd> <td width="57%">&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Customer's NEW GCNumber:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Partner Number:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Partner's GC Number:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Where Purchased:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Installer Full Name:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Installer Phone: </td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Customer's GC Account Number:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Customer Type:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Type of Direcway Service:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Direcway Modem Type:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td colspan="2"><hr></td>
Dd> </tr>
Dd> <tr>
Dd> <td><strong>Verify this information in Netsuite: </strong></td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Status:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Company Name:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Category:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Sales Rep:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Phone:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Alt Phone:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Fax:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>EMail:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Partner:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Lead Source:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Start Date:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Partner Account: </td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Paid by Parent:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Attention:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Addressee:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Phone:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Address1:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Address2:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping City:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping State:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Zip:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Country:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Attention:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Addressee:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Phone:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Address1:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Address2:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing City:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing State:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Country:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Terms:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Price Level:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Company Name:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Credit Card Number: </td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Expiration Date:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Cardholder Name:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Credit Card Type:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Transponder:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>System:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Dish Size:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Public IP:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Numberof IPs:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Bandwidth Subscription:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Bandwidth Cost:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td colspan="2"><hr></td>
Dd> </tr>
Dd> <tr>
Dd> <td><strong>Enter this information into Netsuite:</strong></td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Installation Requested:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Commissioned:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Service Plan:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Equipment &amp; Install:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Satellite:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Address:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Is Taxable:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Tax State:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Bandwidth Order: Bandwidth:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>IP Qty:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>&nbsp;</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> </table>
Dd> </body>
Dd> </html>
--
Tim Musson
Flying with The Bat! eMail v2.12.00
Experience is something you don't get until just after you need it.
Blat Manager, current version is 2.4, see www.blat.net




------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hu9k9ud/M=362335.6886445.7839731.1510227/D=groups/S=1705007389:TM/Y=YAHOO/EXP=1123622361/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->
--
Homepage:
http://www.blat.net
Dan deHam
2005-08-09 20:04:18 UTC
Permalink
I got it to work. I had to double-escape the quotes. Once for putting them
into a perl string, and again for the command line. So my quotes are
escaped like this \\\"

I also had to get rid of the % in my html. I'm not using ' because I need
to put variables into the html. That's also why I'm not reading in the html
from a file.

Thanks,

Daniel
Post by Tim Musson
Hey Daniel,
wow, that is a lot of html in your perl code...
Try using the ' instead of the " char (same key on the keyboard).
Is there any reason you are including all that html code in your perl
code instead of putting it in a file, and reading it in?
You could also use "here documents" to send to Blat like this.
print HTMLout <<End;
End Dd> I'm trying to send an html email on the command line, but the
command Dd> fails because there are quotes in the html. How can I send an
html Dd> message using the command line? Below is my perl script, and
below Dd> that is the output. Dd> Thanks, Dd> Dan Dd>
#!C:/perl/bin/perl.exe -w Dd> use strict; Dd> use Win32::OLE; Dd> use CGI
qw(:standard); Dd> print header; Dd> my $errors; Dd> my $body = "\n"; Dd>
$body .= "\n"; Dd> $body .= "\n"; Dd> $body .= " charset=iso-8859-1\">\n";
Dd> $body .= "\n"; Dd> $body .= "\n"; Dd> $body .= "\n"; Dd> $body .=
"\n"; Dd> $body .= "
\n"; Dd> $body .= " Ground Control Full Order Dd> \n"; Dd> $body .=
" \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Customer\'s NEW GCNumber:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Partner Number:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Partner\'s GC Number:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Where Purchased:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Installer Full Name:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Installer Phone: \n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Customer\'s GC Account Number:\n"; Dd> $body .=
" \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Customer Type:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Type of Direcway Service:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Direcway Modem Type:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= "
----------
\n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Verify this information in Netsuite: Dd> \n"; Dd>
$body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Status:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Company Name:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Category:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Sales Rep:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Phone:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Alt Phone:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Fax:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " EMail:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Partner:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Lead Source:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Start Date:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Partner Account: \n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Paid by Parent:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping Attention:\n"; Dd> $body .= " \n"; Dd> $body
.= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping Addressee:\n"; Dd> $body .= " \n"; Dd> $body
.= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping Phone:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping Address1:\n"; Dd> $body .= " \n"; Dd> $body
.= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping Address2:\n"; Dd> $body .= " \n"; Dd> $body
.= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping City:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping State:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping Zip:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Shipping Country:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing Attention:\n"; Dd> $body .= " \n"; Dd> $body
.= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing Addressee:\n"; Dd> $body .= " \n"; Dd> $body
.= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing Phone:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing Address1:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing Address2:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing City:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing State:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing Country:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Terms:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Price Level:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Billing Company Name:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Credit Card Number: \n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Expiration Date:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Cardholder Name:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Credit Card Type:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Transponder:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " System:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Dish Size:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Public IP:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Numberof IPs:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Bandwidth Subscription:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Bandwidth Cost:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= "
----------
\n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Enter this information into Dd> Netsuite:\n"; Dd>
$body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Installation Requested:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Commissioned:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Service Plan:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Equipment & Install:\n"; Dd> $body .= " \n"; Dd>
$body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Satellite:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Address:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Is Taxable:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Tax State:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " Bandwidth Order: Bandwidth:\n"; Dd> $body .= " \n";
Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " IP Qty:\n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "
\n"; Dd> $body .= " \n"; Dd> $body .= " \n"; Dd> $body .= "
\n"; Dd> $body .= "\n"; Dd> $body .= "\n"; Dd> $body .= "
\n";
Dd> $body .= "\n";
Dd> my $subject = "Full Order Error Occurred";
Dd> #email Dan
Dd> if (MySendMail($to_address,$subject,$body) == 1)
Dd> {
Dd> printf("Mail sent correctly.");
Dd> }
Dd> else
Dd> {
Dd> printf("There was an error sending mail.\n");
Dd> printf("%s",$body);
Dd> }
Dd> #*********************************************************************
Dd> ************
Dd> #================== [ MySendMail ]
Dd> # input parameters are to_address, subject, and body
Dd> # It returns 1 if it succeeds, 0 if it fails
Dd> sub MySendMail
Dd> {
Dd> my $to_param = $params[0];
Dd> my $subject_param = $params[1];
Dd> my $body_param .= $params[2];
Dd> my $ReturnVal = 0;
Dd> # declare the variables we are going to use
Dd> my ($to, $f, $subject, $body, $server, $hostname, $u, $pw, $debug,
Dd> $x, $return);
Dd> # you must change the values marked with
Dd> # populate all the variables we are going to use
Dd> $to = "-to " . $to_param;
Dd> $subject = "-subject \"". $subject_param . "\"";
Dd> $body = "-body \"". $body_param ."\"";
Dd> $server = "-server 67.130.139.34";
Dd> $hostname = "-hostname secure.groundcontrol.com";
Dd> # $pw = "-pw !";
Dd> # $debug = "-debug";
Dd> #$x = "-x \"X-Custom-header: Check it out!\"";
Dd> # Here is where we run Blat.
Dd> # Note, the Perl vars are the same as Blat's paramaters.
Dd> # All the stuff you see Blat return to STDOUT (non error messages
Dd> to
Dd> # the screen) get put in the $return variable.
Dd> # $return = `blat - $to $f $subject $body $server $hostname $u $pw
Dd> $debug $x`;
Dd> $return = `blat - $to $f $subject $body $server $hostname -noh -
Dd> html`;
Dd> #return holds the result from the server
Dd> if (($return =~ m/Subject:/g) && (!($return =~ m/Error:/g)) )
Dd> {
Dd> $ReturnVal = 1;
Dd> }
Dd> else
Dd> {
Dd> $ReturnVal = 0;
Dd> $errors .= "mailer error: " . $return . "\n";
Dd> $errors .= "email body:" . $body_param . "\n";
Dd> }
Dd> #print $return;
Dd> return $ReturnVal;
Dd> }# end: sub MySendMail
Dd> *****************************************************
Dd> OUTPUT
Dd> *****************************************************
D:\cgi-bin\test>>perl html-email.pl
Dd> Content-Type: text/html; charset=ISO-8859-1
Dd> There was an error sending mail.
Dd> <html>
Dd> <head>
Dd> <title>Untitled Document</title>
Dd> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-
1">>
Dd> </head>
Dd> <body>
Dd> <table width="100%" border="0">
Dd> <tr>
Dd> <td width="43%"><strong>Ground Control Full Order </strong></td>
Dd> <td width="57%">&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Customer's NEW GCNumber:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Partner Number:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Partner's GC Number:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Where Purchased:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Installer Full Name:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Installer Phone: </td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Customer's GC Account Number:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Customer Type:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Type of Direcway Service:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Direcway Modem Type:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td colspan="2"><hr></td>
Dd> </tr>
Dd> <tr>
Dd> <td><strong>Verify this information in Netsuite: </strong></td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Status:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Company Name:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Category:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Sales Rep:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Phone:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Alt Phone:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Fax:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>EMail:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Partner:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Lead Source:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Start Date:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Partner Account: </td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Paid by Parent:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Attention:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Addressee:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Phone:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Address1:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Address2:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping City:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping State:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Zip:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Shipping Country:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Attention:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Addressee:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Phone:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Address1:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Address2:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing City:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing State:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Country:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Terms:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Price Level:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Billing Company Name:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Credit Card Number: </td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Expiration Date:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Cardholder Name:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Credit Card Type:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Transponder:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>System:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Dish Size:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Public IP:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Numberof IPs:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Bandwidth Subscription:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Bandwidth Cost:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td colspan="2"><hr></td>
Dd> </tr>
Dd> <tr>
Dd> <td><strong>Enter this information into Netsuite:</strong></td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Installation Requested:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Commissioned:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Service Plan:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Equipment &amp; Install:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Satellite:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Address:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Is Taxable:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Tax State:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>Bandwidth Order: Bandwidth:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>IP Qty:</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> <tr>
Dd> <td>&nbsp;</td>
Dd> <td>&nbsp;</td>
Dd> </tr>
Dd> </table>
Dd> </body>
Dd> </html>
--
Tim Musson
Flying with The Bat! eMail v2.12.00
Experience is something you don't get until just after you need it.
Blat Manager, current version is 2.4, see www.blat.net
--
http://www.blat.net
http://groups.yahoo.com/group/blat
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hvoord8/M=362335.6886445.7839731.1510227/D=groups/S=1705007389:TM/Y=YAHOO/EXP=1123625062/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->
--
Homepage:
http://www.blat.net
namtog
2005-08-09 20:10:09 UTC
Permalink
Post by Dan deHam
I got it to work. I had to double-escape the quotes. Once for
putting them
Post by Dan deHam
into a perl string, and again for the command line. So my quotes are
escaped like this \\\"
I also had to get rid of the % in my html. I'm not using ' because I need
to put variables into the html. That's also why I'm not reading in the html
from a file.
Thanks,
Daniel
Greetings Daniel,

Thats great. Thanks for stopping back to let us all know how you
solved the problem. I wish more folks would do that. I pick up a lot
of good pointers from the feed back in these forums.

Namtog





------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hraum5n/M=362131.6882499.7825260.1510227/D=groups/S=1705007389:TM/Y=YAHOO/EXP=1123625412/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~->
--
Homepage:
http://www.blat.net
Tim Musson
2005-08-10 11:50:06 UTC
Permalink
Hey Dan,

On Tuesday, August 9, 2005 at 4:04:18 PM you wrote

Dd> I got it to work. I had to double-escape the quotes. Once for
Dd> putting them into a perl string, and again for the command line.
Dd> So my quotes are escaped like this \\\"

Dd> I also had to get rid of the % in my html. I'm not using ' because
Dd> I need to put variables into the html. That's also why I'm not
Dd> reading in the html from a file.

I wondered if that was the case, but I didn't see the vars in my quick
look.

What I would suggest then to keep your Perl code a bit more readable,
is use the single quote everywhere you don't have vars included, but
then your escaped quotes where you do.
--
Tim Musson
Flying with The Bat! eMail v2.12.00
The days of the digital watch are numbered.
Blat Manager, current version is 2.4, see www.blat.net




------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hnr3lpj/M=362329.6886308.7839368.1510227/D=groups/S=1705007389:TM/Y=YAHOO/EXP=1123681834/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~->
--
Homepage:
http://www.blat.net
Continue reading on narkive:
Loading...