🔒 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
  • 776
    Views
  • 8
    Participants
Last reply from:
nogats07

Online now

Members online
1,026
Guests online
718
Total visitors
1,744

Forum statistics

Threads
2,276,959
Posts
28,973,344
Members
1,229,665
Latest member
hellowwolrd
Back
Top