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
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sending email to a user
#11
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.
  Reply
#12
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."
  Reply
#13
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!
  Reply
#14
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
  Reply
#15
Any chance of someone responding to this please?
  Reply
#16
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.
  Reply
#17
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)))
  Reply
#18
Glad you got it! Sorry for the delay!
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)