xaroiant Posted October 23, 2017 Posted October 23, 2017 (edited) Hi, I have a forgot password page on my website (custom coded) I am trying to send reset password emails. The first one went through and here is the code for it: $to = $email; $subject = "Staff - Password Reset"; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= "From: admin@differentcraft-staff.tk"; $message = " <html> <head> <title>Password Reset</title> <body> <h1>Password Reset</h1> <p>You are receiving this email because your username and email were used at our <a href='https://differentcraft-staff.tk/forgot'>password reset</a> page.</p> <p>To reset your password, please click on <a href='https://differentcraft-staff.tk/reset/".$resetcode."'>this</a> link.</p> <p>If this link does not work, please go to <a href='https://differentcraft-staff.tk/reset/".$resetcode."'>https://differentcraft-staff.tk/reset/".$resetcode."</a></p> <p>If you did not request this password reset, you can safely ignore this email!</p> </body> </html> "; mail($to, $subject, $message, $headers); Note that the opening and closing PHP tags are there. I am slightly confused as to why this is happening and would appreciate any help you guys can give me. Thanks for reading,Redstone Edited October 24, 2017 by Krydos
wolstech Posted October 23, 2017 Posted October 23, 2017 You probably got throttled for sending too many emails. There's a few reasons for this happening, the most common being sending too many emails. Escalating.
xaroiant Posted October 23, 2017 Author Posted October 23, 2017 (edited) This is the first email I have sent with my hosting account. Edited October 23, 2017 by xaroiant
wolstech Posted October 23, 2017 Posted October 23, 2017 In that case, it's possible something else caused it. The limit is supposed to be 50 emails per day. Usually being able to send 1 email is a sign of throttling due to overuse, which shouldn't be the case here. Our root admin Krydos can check and see why you aren't able to send mail. Have you checked the result of mail()? It should return true if it's sending/thinks it sent mail. Also I'm assuming you've tried sending to a different recipient address and checked the spam bin (email from us has been known to erroneously flag as spam)?
xaroiant Posted October 23, 2017 Author Posted October 23, 2017 (edited) I have put on the message on the page to check your spam folder. I have tried sending it to a different email address only to get the same result. (Sends once then does not send again) Edited October 23, 2017 by xaroiant
Krydos Posted October 24, 2017 Posted October 24, 2017 So far today your account has tried to send 65 emails. Due to the excessive email sending without first asking permission to send more than the standard amount your account has been throttled to one per hour.
xaroiant Posted October 24, 2017 Author Posted October 24, 2017 My code should have only tried to send 5. I am confused as to where the remaining 60 were from.
Krydos Posted October 24, 2017 Posted October 24, 2017 Well, it's kind of pointless to remove the throttle if your account is going to continue sending so many emails because you'll just get automatically throttled again the next day. So far in the last 6 hours and 45 minutes you've send 12 emails. Let us know if you figure out where they're coming from.
xaroiant Posted October 24, 2017 Author Posted October 24, 2017 In the last 12 hours, I have not opened my site AT ALL. Inam confused as to where these emails are going. Definitely not into my inbox.
wolstech Posted October 24, 2017 Posted October 24, 2017 (edited) Seeing your site is a forum, it's almost certainly spambots or possibly scheduled emails (if your forum does things like send a digest to users). Does your site send a welcome or activation email? If so, the bots trying to sign up will cause this. The bot can't actually complete registration, but simply clicking Register and filling in the form causes the activation email to send, which counts towards your limit. Try disabling the email functions on your forum. Also, note that the email limit is for the entire account, not a specific domain, so the script you're developing above is still affected by the forum, even if the domains are different for each. Edited October 24, 2017 by wolstech
xaroiant Posted October 24, 2017 Author Posted October 24, 2017 Was disabled before I had this problem.
xaroiant Posted October 25, 2017 Author Posted October 25, 2017 This makes no sense to me at all. Where are these emails coming from and what is the cause of them?
Krydos Posted October 25, 2017 Posted October 25, 2017 Probably the forum like wolstech said. Want to try removing it entirely for a day or so?
xaroiant Posted October 25, 2017 Author Posted October 25, 2017 I have had all email functionality disabled entirely on my forum for the past week.
Recommended Posts