Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Template Shares
Notices

Reply
Thread Tools
  #21  
Old 30th August 2024, 10:58
ratataa ratataa is offline
Member
 
Join Date: Aug 2024
Posts: 9
Default
use Zoho mail
Reply With Quote
  #22  
Old 3rd January 2025, 19:32
miralsplet's Avatar
miralsplet miralsplet is offline
Senior Member
 
Join Date: Nov 2013
P2P
Posts: 90
Default USE THIS
https://app-eu.smtp2go.com/
Quote:
Originally Posted by Dani18 View Post
I also have the same problem with tsue, but I haven't solved it
Reply With Quote
  #23  
Old 22nd January 2025, 11:05
hart's Avatar
hart hart is offline
Senior Member
 
Join Date: Sep 2010
P2P
Posts: 56
Default
anyone solved this problem?
Reply With Quote
  #24  
Old 22nd January 2025, 20:35
miralsplet's Avatar
miralsplet miralsplet is offline
Senior Member
 
Join Date: Nov 2013
P2P
Posts: 90
Default
You must edit admincp/indexphp and class.smtp.php and yose this api https://app-eu.smtp2go.com/
Reply With Quote
  #25  
Old 25th January 2025, 09:45
hart's Avatar
hart hart is offline
Senior Member
 
Join Date: Sep 2010
P2P
Posts: 56
Default
Quote:
Originally Posted by miralsplet View Post
You must edit admincp/indexphp and class.smtp.php and yose this api https://app-eu.smtp2go.com/
what should I edit?more precisely, please
Reply With Quote
  #26  
Old 5th March 2025, 21:12
miralsplet's Avatar
miralsplet miralsplet is offline
Senior Member
 
Join Date: Nov 2013
P2P
Posts: 90
Default TSUE AND api.smtp2go.com INTEGRATE
PHP Code:
<?php 

class TSUESMTP
{
    public 
$smtpSocket NULL;
    public 
$smtpReturn 0;
    public 
$secure "";
    public 
$toemail "";
    public 
$toname "";
    public 
$subject "";
    public 
$message "";
    public 
$headers "";
    public 
$fromemail "";
    public 
$delimiter "\r\n";
    public 
$Settings = array(  );

    public function 
TSUESMTP()
    {
        global 
$TSUE;
        
$this->secure = ($TSUE["TSUE_Settings"]->settings["global_settings"]["smtp_secure"] == "tls" "none");
    }

    public function 
start($toemail$toname ""$subject$message$from$fromname)
    {
        global 
$TSUE;
        
$toemail $this->fetch_first_line($toemail);
        if( empty(
$toemail) ) 
        {
            return 
false;
        }

        
$delimiter =& $this->delimiter;
        
$toemail $this->dounhtmlspecialchars($toemail);
        
$subject $this->fetch_first_line($subject);
        
$message preg_replace("#(\r\n|\r|\n)#s"$delimitertrim($message));
        if( (
strtolower($TSUE["TSUE_Language"]->charset) == "iso-8859-1" || $TSUE["TSUE_Language"]->charset == "") && preg_match("/&[a-z0-9#]+;/i"$message) ) 
        {
            
$message utf8_encode($message);
            
$subject utf8_encode($subject);
            
$encoding "UTF-8";
            
$unicode_decode true;
        }
        else
        {
            
$encoding $TSUE["TSUE_Language"]->charset;
            
$unicode_decode false;
        }

        
$message $this->dounhtmlspecialchars($message$unicode_decode);
        
$subject $this->encode_email_header($this->dounhtmlspecialchars($subject$unicode_decode), $encodingfalsefalse);
        
$from $this->fetch_first_line($from);
        
$mailfromname = ($fromname $this->fetch_first_line($fromname) : $from);
        if( 
$unicode_decode == true 
        {
            
$mailfromname utf8_encode($mailfromname);
        }

        
$mailfromname $this->encode_email_header($this->dounhtmlspecialchars($mailfromname$unicode_decode), $encoding);
        if( !isset(
$headers) ) 
        {
            
$headers "";
        }

        
$headers .= "From: " $mailfromname " <" $from ">" $delimiter;
        
$headers .= "Return-Path: " $from $delimiter;
        
$headers .= "Message-ID: <" gmdate("YmdHis") . "." substr(md5($message microtime()), 012) . "@" $TSUE["TSUE_Settings"]->settings["global_settings"]["website_url"] . ">" $delimiter;
        
$headers .= "MIME-Version: 1.0" $delimiter;
        
$headers .= "Content-Type: text/html" . (($encoding "; charset=\"" $encoding "\"" "")) . $delimiter;
        
$headers .= "Content-Transfer-Encoding: 8bit" $delimiter;
        
$headers .= "X-Priority: 3" $delimiter;
        
$headers .= "X-Mailer: TSUE Mail via PHP" $delimiter;
        
$headers .= "X-Sender: TSUE PHP-Mailer" $delimiter;
        
$headers .= "Date: " date("r") . $delimiter;
        
$this->toemail $toemail;
        
$this->toname $toname;
        
$this->subject $subject;
        
$this->message $message;
        
$this->headers $headers;
        
$this->fromemail $from;
    }

    public function 
send()
    {
        global 
$TSUE;
        if( !
$this->toemail 
        {
            return 
false;
        }

        
$apiKey 'api-4B9753D6AC604B78B67E0A200476488F';
        
$url 'https://api.smtp2go.com/v3/email/send';
        
$data = [
            
'sender' => $this->fromemail,
            
'to' => explode(','$this->toemail),
            
'subject' => $this->subject,
            
'text_body' => strip_tags($this->message),
            
'html_body' => $this->message
        
];

        
$options = [
            
'http' => [
                
'header'  => "Content-Type: application/json\r\n" .
                             
"X-Smtp2go-Api-Key: $apiKey\r\n",
                
'method'  => 'POST',
                
'content' => json_encode($data),
            ],
        ];

        
$context  stream_context_create($options);
        
$result file_get_contents($urlfalse$context);

        if (
$result === FALSE) {
            return 
$this->errorMessage("Unable to send email via API");
        }

        return 
true;
    }

    public function 
fetch_first_line($text)
    {
        
$text preg_replace("/(\r\n|\r|\n)/s""\r\n"trim($text));
        
$pos strpos($text"\r\n");
        if( 
$pos !== false 
        {
            return 
substr($text0$pos);
        }

        return 
$text;
    }

    public function 
dounhtmlspecialchars($text$doUniCode false)
    {
        if( 
$doUniCode 
        {
            
$text preg_replace("/&#([0-9]+);/esiU""convert_int_to_utf8('\\1')"$text);
        }

        return 
str_replace(array( "&lt;""&gt;""&quot;""&amp;" ), array( "<"">""\"""&" ), $text);
    }

    public function 
encode_email_header($text$charset "utf-8"$force_encode false$quoted_string true)
    {
        
$text trim($text);
        if( !
$charset 
        {
            return 
$text;
        }

        if( 
$force_encode == true 
        {
            
$qp_encode true;
        }
        else
        {
            
$qp_encode false;
            for( 
$i 0$i strlen($text); $i++ ) 
            {
                if( 
127 ord($text[$i]) ) 
                {
                    
$qp_encode true;
                    break;
                }

            }
        }

        if( 
$qp_encode == true 
        {
            
$outtext preg_replace("#([^a-zA-Z0-9!*+\\-/ ])#e""'=' . strtoupper(dechex(ord(str_replace('\\\"', '\"', '\\1'))))"$text);
            
$outtext str_replace(" ""_"$outtext);
            
$outtext "=?" $charset "?q?" $outtext "?=";
            return 
$outtext;
        }

        if( 
$quoted_string 
        {
            
$text str_replace(array( "\"""("")" ), array( "\\\"""\\(""\\)" ), $text);
            return 
"\"" $text "\"";
        }

        return 
preg_replace("#(\\r\\n|\\n|\\r)+#"" "$text);
    }

    public function 
errorMessage($msg)
    {
        global 
$TSUE;
        if( 
$TSUE["TSUE_Settings"]->settings["global_settings"]["smtp_debug"] == "1" 
        {
            
trigger_error($msg512);
        }

        return 
false;
    }
}
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 10:46. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2025, vBulletin Solutions Inc.