Send2Freind troubles

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
stealth
Posts: 7
Joined: Mon Feb 05, 2007 12:43 am

Send2Freind troubles

Post by stealth »

I have a little problem;
The Send2Freind script doesn't work for me as designed.
I'm looking for a work around.

My server requires that any script based sent mail has either the From: or To: elements of the email to have a valid email which is hosted on the server the script is being run from.

With the Send2Freind script it doesn't have this compliance with ver phpMyFAQ 1.6.8 or phpMyFAQ 1.6.11

Any ideas on a work around for this?
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
what about always adding the PMF webmaster email in <To:>?

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
stealth
Posts: 7
Joined: Mon Feb 05, 2007 12:43 am

Post by stealth »

Yes this is what I was looking into doing in the mailsend2friend.php but I'm not quite sure how to place it in the code. I made a couple attempts yesterday but had no success.
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
stealth wrote:Yes this is what I was looking into doing in the mailsend2friend.php but I'm not quite sure how to place it in the code. I made a couple attempts yesterday but had no success.
change this code below:

Code: Select all

...
            if ($mail != "") {
                mail(
                    $IDN->encode($mail),
                    $PMF_LANG["msgS2FMailSubject"].$name,
                    $PMF_CONF["send2friend_text"]."\r\n\r\n".$PMF_LANG["msgS2FText2"]."\r\n".$link."\r\n\r\n".$attached,
                    "From: ".$IDN->encode($mailfrom)
                );
                usleep(500);
            }
...
into:

Code: Select all

...
            if ($mail != "") {
                mail(
                    $IDN->encode($mail),
                    $PMF_LANG["msgS2FMailSubject"].$name,
                    $PMF_CONF["send2friend_text"]."\r\n\r\n".$PMF_LANG["msgS2FText2"]."\r\n".$link."\r\n\r\n".$attached,
                    "From: ".$IDN->encode($mailfrom)."\r\nCc: ".$IDN->encode($PMF_CONF['adminmail'])
                );
                usleep(500);
            }
...
Please backup the mailsend2friend.php file before applying the mod, to easily return to the original code if needed.

Ciao,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
stealth
Posts: 7
Joined: Mon Feb 05, 2007 12:43 am

Post by stealth »

I was in the right place with the right idea but didn't have the right syntax.
Works like a charm :D

Thanks a heap :!: :!:
samtheman
Posts: 7
Joined: Fri Jun 01, 2007 4:22 pm

send to friend

Post by samtheman »

I have tried the solution you have published but it still does not work, it only sends the email to the admin user (which is me) but does not send to the additional email addresses you put down, can anyone suggest what to do to get this useful essential feature working?

thnaks
Post Reply