in reply to smtp authentication in perl script for contact form
Perl provides many ways to help you if you let it.
If you put the line use warnings; near the top of your script, Perl will tell you what goes wrong. In your case, Perl sees a variable, @xxxx in the string "username@xxxx.com" in your code.
If you want to turn such instances of misspelled or misidentified variable names into errors, add the line use strict; near the top of your program as well. This is considered good programming practice.
The easiest fix in your case is to use single quotes instead of double quotes, because strings in single quotes are never examined by Perl for containing variable names:
$Set_From='xxxxx@xxxxxx.com'; $username = '????@????.com';
But note that your script is a huge open gate for spammers. You never check whether $fromaddr contains what you think it should. For example, a malicious user could sent MAIL TO: everybody@gmail.com\nSubject: Buy Viagra\n\nBuy cheap viagra into $fromaddr and your script would then blast out an email in your name to the spammers mail list. Please take a look at the nms formmail script, which does not contain such security holes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: smtp authentication in perl script for contact form
by Anonymous Monk on Nov 30, 2015 at 15:35 UTC | |
by Corion (Patriarch) on Nov 30, 2015 at 15:49 UTC | |
by Anonymous Monk on Dec 01, 2015 at 12:48 UTC | |
by Corion (Patriarch) on Dec 01, 2015 at 13:11 UTC |