Jump to content

Send an email when file is uploaded


Elusid

Recommended Posts

Ok how can I get my site to send me an email when a new file is uploaded with one of my uploaders? I have several uploaders on my site and I want it so when the user uploads the files it will send me an email saying that they have uploaded it and give me the URL to the folder where it was uploaded. It makes is a lot easer then having to go through the site looking all the time. Thanks!
Link to comment
Share on other sites

Ok so I tried this code

[code]
<?php
// The message
$message = "Line 1\nLine 2\nLine 3";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);

// Send
mail('tech108@gmail.com', 'My Subject', $message);
?>
[/code]

and uploaded it to my server. When I go to the url of the file it's a while screen, no error, and I don't get an email. How do I get this to work right?
Link to comment
Share on other sites

@redarrow,

perhaps you should re-read the manual. Nothing wrong with Elusid's wordwrap() call.

[code]<?php
$text = "This is the text to word wrapped so the lines are a maximum length of twenty characters";
echo '<pre>', wordwrap($text, 20), '</pre>';
?>[/code]

gives -->
[pre]This is the text to
word wrapped so the
lines are a maximum
length of twenty
characters
[/pre]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.