/    Sign up×
Community /Pin to ProfileBookmark

Send Page By Email

Send Page By Email

I have a send page to friend link and i want to write a function that sends the content of the page to user’s friend by email.

is there a way to dothat in javascript?

thanks

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJun 21.2006 — No, not with any reliability anyway. Such things are done using server-side code.
Copy linkTweet thisAlerts:
@NinaWilliamauthorJun 22.2006 — what about a combanation of javascript and server side code? can i do that?
Copy linkTweet thisAlerts:
@phpnoviceJun 22.2006 — What did you have in mind? If the page content is equal to what was sent from the server -- i.e., no changes made by the visitor -- then there is no reason to use JavaScript. The following form will tell the server-side code what page to send and to whom (for this to work, all of your pages would be changed to have the [B].php[/B] extension):

<form method="post" action="sendpage.php?url=<?=urlencode($_SERVER['PHP_SELF'])?>">

<p>Send to email address:

<input type="text" name="email" size="30">

<input type="submit" value="Send"></p>

</form>

Beyond that, only the sendpage.php document would need to be created.
Copy linkTweet thisAlerts:
@LeeUJun 22.2006 — phpnovice,

Will that work if the server is set to process the ".htm" extension as php? (I don't know PHP too good.)
Copy linkTweet thisAlerts:
@phpnoviceJun 22.2006 — Any file extension that the server will run through the PHP processor will work, yes. In addition, this line can be hard-coded so that it doesn't have to go through the PHP processor:

<form method="post" action="sendpage.php?url=<?=urlencode($_SERVER['PHP_SELF'])?>">

That would go like this:

<form method="post" action="sendpage.php?url=/folder/thispage.htm">
Copy linkTweet thisAlerts:
@LeeUJun 22.2006 — Thanks!

I have a Perl script that sends a Web page, if you're interested NinaWilliam. It gives a choice of sending a link or the page itself and then sending the page as an attachment or in the body of the e-mail. Send me a PM with your e-mail and I will send it to you. I didn't write it but the guy who did can't be found. Just need to keep the credit in it. I use to use it and it worked fine.
×

Success!

Help @NinaWilliam spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...