vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Making use of the vbmail function ? (https://vborg.vbsupport.ru/showthread.php?t=68083)

cinq 08-07-2004 01:50 PM

Making use of the vbmail function ?
 
Am planning to make use of this function to notify a member ( via email ) when someone comments on something he/she posted.

PHP Code:

$subjectEmail Notification: New Comment Posted';
$message="A new comment was posted. Please login to check.";
vbmail($vboptions['
webmasteremail'], $subject, $message); 

Now this code would send the email notification to the webmaster ( ie. me ).
But say this email notification was supposed to be sent to a member called "Helloworld", how can I pass it into the vbmail function , using his userid ?

Will this work ? :
( assuming data[userid] came from a query result )
PHP Code:

$usersid $data['userid'];
$user fetch_userinfo($usersid);
$username $user['username'];

$subjectEmail Notification: New Comment Posted';
$message="A new comment was posted. Please login to check.";
vbmail($user['
username'], $subject, $message); 

Any advice would be much appreciated. :)
Thanks

nexialys 08-07-2004 02:22 PM

this is the right way to do it... ;)

Modin 08-07-2004 03:10 PM

Quote:

PHP Code:

$usersid $data['userid'];
$user fetch_userinfo($usersid);
$username $user['username'];

$subjectEmail Notification: New Comment Posted';
$message="A new comment was posted. Please login to check.";
vbmail($user['
username'], $subject, $message); 


close but I think you want
PHP Code:

$usersid $data['userid'];
$user fetch_userinfo($usersid);
$username $user['username'];

$subject'Email Notification: New Comment Posted';
$message="A new comment was posted. Please login to check.";
vbmail($user['email'], $subject$message); 

Modin

cinq 08-07-2004 03:16 PM

Cool, thanks for the prompt replies folks.
Thanks Modin for that correction :)

tazzarkin 03-19-2008 06:39 PM

does this still work? or is this invalid?


All times are GMT. The time now is 01:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01069 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete