Send mail using an email account created on Hostinger PHP

0 votes

I am using an email I created on the hpanel to send emails through PHPMailer.  The code is hosted on hostinger's hpanel and it didn't show any errors but it also didn't give any feedback if the mail is sent or not.

        require '../../vendor/autoload.php';

        $mail = new PHPMailer(true);
        try
        {
            $mail->SMTPDebug = SMTP::DEBUG_SERVER;
            
            $mail->isSMTP();
            $mail->Host = 'smtp.titan.email';
            $mail->SMTPAuth = true;
            $mail->Username = 'admin@hostinger.com';
            $mail->Password = 'password';
            $mail->SMTPSecure = 'SSL';
            $mail->Port = 465;

            $mail->setFrom('admin@hostinger.com', 'Hostinger');
            $mail->addAddress($email, $username);
            $mail->addReplyTo('admin@hostinger.com', 'For any Information');
            $mail->addCC('admin@hostinger.com');
            
            $mail->isHTML(true);
            $mail->Subject = 'Sending message';
            $mail->Body    = $message;
            $mail->AltBody = "Hello there";

            $mail->send();

            echo "Sent";
        }
        catch (Exception $eax) 
        {
            echo 'EMAIL SENDING FAILED. INFO: '.$mail->ErrorInfo;
        }

Can someone help me in solving this?

Jun 7 in PHP by Kichu
• 19,040 points
42 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to send email using php?

Hello @kartik 1.) Download PHPMailer, open the zip file ...READ MORE

answered Apr 1, 2020 in PHP by Niroj
• 82,720 points
479 views
0 votes
1 answer

How to check if a string is an email address in PHP?

Hello, Try this without regular expressions: <?php ...READ MORE

answered Nov 3, 2020 in PHP by Niroj
• 82,720 points
367 views
0 votes
0 answers

How to pop an alert message box using PHP?

How to pop an alert message box ...READ MORE

Jun 3 in PHP by Kichu
• 19,040 points
10 views
0 votes
0 answers

Edit PHP query code depending on image map clicked area using AJAX

I am working on an image map ...READ MORE

Jun 3 in PHP by Kichu
• 19,040 points
9 views
0 votes
0 answers

How to reverse an array in php WITHOUT using the array reverse method

I have an array called reverse array ...READ MORE

Jun 12 in PHP by narikkadan
• 10,840 points
13 views
0 votes
0 answers

How can i send an image map area id to a php file?

This is my image map: <map name="frozen"> ...READ MORE

Jun 16 in PHP by narikkadan
• 10,840 points
11 views
0 votes
0 answers

PHPMailer: SMTP Error: Could not connect to SMTP host

I am having trouble sending mail through ...READ MORE

May 8 in PHP by Kichu
• 19,040 points
124 views
0 votes
0 answers
0 votes
0 answers

phpmailer error "Could not instantiate mail function"

I'm getting the error "Mailer Error: Could ...READ MORE

Jun 13 in PHP by narikkadan
• 10,840 points
22 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP