I have frantically checked for the occurrence of that '! ', but could not find any in my program. Can anyone please shed some lights as to whats wrong here.
$sender = "test\@example.com";
my $message = '';
$message .= "We appreciate your interest in the 123greetings Studio. If you have any questions or need any help, please contact us by email at ";
$message .= "<a href=mailto:" . $sender . ">test@example.com.</a><br><br>";
$message .= "Enjoy your stay with us!" . "<br><br>";
my $msg = MIME::Lite->new(
From => $sender,
Reply-To => $sender,
To => $userMail,
Subject => "Thank You",
Type => 'multipart/mixed'
);
$msg->attach(
Type =>'text/html',
Data => qq($message)
);
my $mail = $msg->as_string;
$smtp = Net::SMTP_auth->new('mail.somesmtp.com',Port=>1234);
$smtp->auth('#*$!x', '#*$!#*$!x', '#*$!#*$!xx');
$smtp->mail('postmaster@example.com');
$smtp->to($userMail);
$smtp->data();
$smtp->datasend($mail);
MIME::Lite->send('smtp', $host, Timeout=>60
AuthUser=>$user, AuthPass=>$pass);
$message .= "<a href=mailto:" . $sender . ">test@example.com.</a><br><br>";
The @ symbol needs to be escaped: \@
Not sure if that has anything to do with the problem but it does need to be fixed otherwise the link text will be broken although the actual link should still work ($sender).
Its also a little confusing why you are using MIME::Lite to construct the email but then use NET::SMTP to send the email. Just use MIME::Lite for the entire process.