🔒 Closed Phpmailer not working on hosting site

Status
Not open for further replies.

IIZeroHourII

Eternal Poster
Pahelp po Working naman sa localhost nakakapag send ng email. pero pag inupload na sa hosting site. di na nag sesend ng email.

PHP:
if($count == 1) {
        $actual_link = "$_SERVER[HTTP_HOST]/php/verify_user_registration.php?student_number=$student_number&firstname=$firstname&middlename=$middlename&lastname=$lastname&suffix=$suffix&email=$newemail&verify_user_registration=";
        
        try {
            //Server settings
            $mail->isSMTP();                                            //Send using SMTP
            $mail->Host       = 'smtp.gmail.com';                     //Set the SMTP server to send through
            $mail->SMTPAuth   = true;                                   //Enable SMTP authentication
            $mail->Username   = 'maynardhalili91@gmail.com';                     //SMTP username
            $mail->Password   = '*******';                               //SMTP password
            $mail->SMTPSecure = "tls";           //Enable implicit TLS encryption
            $mail->Port       = 587;                                    //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
        
            //Recipients
            $mail->setFrom('maynardhalili91@gmail.com');
            $mail->addAddress($email);     //Add a recipient
        
            //Content
            $mail->isHTML(true);                                  //Set email format to HTML
            $mail->Subject = 'Saint Jude Email Verification';
            $mail->Body    = 'Click this link to proceed in creating your account: '.$actual_link;
        
            $mail->send();

            $_SESSION['emailsent'] = "Check your email to Continue on registration";
            header("location: ../registration-student_1.php");
        } catch (Exception $e) {
            echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
        }
 
Hindi pwede or disabled ang functions ng PHP
PHP:
mail()
sa mga free hosting since included lang yun sa mga premium packages nila. Same as
Perl:
/usr/lib/sendmail
using Perl script hindi rin pwede. Pwera nalang kung naka relay server ka pwede yun sa free hosting package nila.
 
sa pagkaka alam ko, bawal yan sa infinityfree, malakas kasi sa cpu kapag nagsesend ng email. bili ka premium hosting.
 
Status
Not open for further replies.

About this Thread

  • 12
    Replies
  • 791
    Views
  • 8
    Participants
Last reply from:
nogats07

Trending Topics

Online now

Members online
1,048
Guests online
3,277
Total visitors
4,325

Forum statistics

Threads
2,332,535
Posts
29,266,022
Members
1,144,373
Latest member
balic
Back
Top