The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
sending email to a user - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29)
+--- Thread: sending email to a user (/showthread.php?tid=356)

Pages: 1 2


sending email to a user - LBC - 11-25-2016

Thanks mudmin.

Here is the form php code again: http://pastebin.com/SKXkrhS7

And here is the actual form: http://pastebin.com/aygbnBJ2

Changing what you suggested did not seem to work. I am still getting the "Oops! Something went wrong. Your message has NOT been sent!" error.



sending email to a user - mudmin - 11-25-2016

Just double checking. Are you able to send test emails when you go into the admin panel -> mail settings -> Save and Test Email?

If you are using gmail you might need to enable "less secure apps."


sending email to a user - mudmin - 11-25-2016

Ok. So this is a standalone page. I didn't run a query to find the user (the $thatUser) query, so if you want to test it, just go in on line 39 and put a real "to" email address there.

http://pastebin.com/ukxgegtx

A few things I changed...
For your errors I changed from
Code:
if !$errName
to
Code:
if (!isset($errName)
to stop it from throwing errors.

Also, the form was throwing errors if there was no input on it, so I made the value and the errors only be able to show up if the form had already been posted...
Code:
value="<?php if($_POST){echo htmlspecialchars($_POST['name']);} ?>">
Code:
<?php if($_POST){echo "<p class='text-danger'>$errName</p>";}?>

Finally, I changed the email function from mail to email to use the built in userspice one.

Again, if you cannot send an email from the test page, you're not going to be able to send one here.

I hope that helps!


sending email to a user - LBC - 11-29-2016

I'm afraid its still not working. I'm still getting the oops message Sad

Not quite sure what you meant by changing the email function from mail to email though.
Did you mean in the email settings? Or in this profile.php page?

Oh, and I can send an email test Smile


sending email to a user - LBC - 01-09-2017

Any chance of someone responding to this please?


sending email to a user - LBC - 01-09-2017

I think it must have something to do with the
Code:
$to = $thatUser->email;
because I can send the e-mail if I replace that with an actual e-mail address.


sending email to a user - LBC - 01-09-2017

Okay, never mind...I added this
Code:
action="profile.php?id=<?=$thatUser->id?>"
to the form action and everything seems to work so far Smile)))


sending email to a user - mudmin - 01-11-2017

Glad you got it! Sorry for the delay!