M
Michael
I know that in order to send an e-mail using Perl there must be a '\'
in front of the '@' symbol. For example department\@company.com. And
it works.
The problem that I am having is that we have many customers whom we
need to direct towards their own personal online order form. For some
reason when I try to place the '\' in front of the '@' symbol it does
not work.
For example (e-mail address removed). In order to send them an e-mail we need to
place the to have their email address take the form of
person\@isp.com.
However when i use the substr function the address remains the same.
substr([email protected], $where, 1) = "\@";
# attempt to insert '\' before '@'
The email address remains (e-mail address removed) even after using substr.
Can anyone help me out with this?
A more detailed coding segment is below (it's not long).
#!/usr/bin/perl -w
use CGI qwall);
print "Content-type: text/html\n\n";
$EmailAddress = param("textEmailAddress");
# From Text box on prev. page
print "EmailAddress is currently $EmailAddress";
# Check if email received
$where = index($EmailAddress, "@");
# Find the '@' symbol in the e-address
if ($where != -1) # If '@' symbol is in the e-address then
{
print "@ symbol found";
# Check to see if correct
substr($EmailAddress, $where, 1) = "\@";
# Insert "\" before the "@" symbol in the EmailAddress
print "EmailAddress is now $EmailAddress";
# Check the current value of EmailAddress
}
else # If '@' symbol is not in the e-address then
{
print "@ symbol not found";
# Check to see if correct
print "where equals $where";
# Check to see if correct
}
open(MAIL, "|/usr/sbin/sendmail -oi -t"); #Sending the email
print MAIL <<EOM;
From: department\@company.com
To: $EmailAddress
Subject: "Your Order Form"
Here is your order form
EOM
close(MAIL);
in front of the '@' symbol. For example department\@company.com. And
it works.
The problem that I am having is that we have many customers whom we
need to direct towards their own personal online order form. For some
reason when I try to place the '\' in front of the '@' symbol it does
not work.
For example (e-mail address removed). In order to send them an e-mail we need to
place the to have their email address take the form of
person\@isp.com.
However when i use the substr function the address remains the same.
substr([email protected], $where, 1) = "\@";
# attempt to insert '\' before '@'
The email address remains (e-mail address removed) even after using substr.
Can anyone help me out with this?
A more detailed coding segment is below (it's not long).
#!/usr/bin/perl -w
use CGI qwall);
print "Content-type: text/html\n\n";
$EmailAddress = param("textEmailAddress");
# From Text box on prev. page
print "EmailAddress is currently $EmailAddress";
# Check if email received
$where = index($EmailAddress, "@");
# Find the '@' symbol in the e-address
if ($where != -1) # If '@' symbol is in the e-address then
{
print "@ symbol found";
# Check to see if correct
substr($EmailAddress, $where, 1) = "\@";
# Insert "\" before the "@" symbol in the EmailAddress
print "EmailAddress is now $EmailAddress";
# Check the current value of EmailAddress
}
else # If '@' symbol is not in the e-address then
{
print "@ symbol not found";
# Check to see if correct
print "where equals $where";
# Check to see if correct
}
open(MAIL, "|/usr/sbin/sendmail -oi -t"); #Sending the email
print MAIL <<EOM;
From: department\@company.com
To: $EmailAddress
Subject: "Your Order Form"
Here is your order form
EOM
close(MAIL);