Table of Contents
ecshop implements smtp to send emails, ecshopsmtp sends emails
Home Backend Development PHP Tutorial ecshop implements smtp to send emails, ecshopsmtp sends emails_PHP tutorial

ecshop implements smtp to send emails, ecshopsmtp sends emails_PHP tutorial

Jul 13, 2016 am 10:08 AM
ecshop smtp send email Email reply

ecshop implements smtp to send emails, ecshopsmtp sends emails

When using ECShop's smtp method to send emails, in the cls_smtp class file, execute the statement in the get_data method:

Copy code The code is as follows:

$line = fgets($this->connection, 512);

;, a timeout error occurred.

Comment out the execution of this function and send the email directly, the error ehlo command failed will be returned.

But when the link data is printed out, it is indeed connected.

I could send emails normally using other programs before, so I resend the function and use phpmailer to send emails instead.

Copy code The code is as follows:

function smtp_mail($name, $email, $subject, $content, $type = 1, $notification=false) {
/* If the email encoding is not EC_CHARSET, create a character set conversion object and convert the encoding */
If ($GLOBALS['_CFG']['mail_charset'] != EC_CHARSET)
{
          $name                                                                                                                                                                                                                                                                      $subject                                                                                                                                       $subject                                                                                                             $ Content = ECS_ICONV (EC_CHARSET, $ Globals ['_ cfg'] ['Mail_charset'], $ Content);
        $shop_name = ecs_iconv(EC_CHARSET, $GLOBALS['_CFG']['mail_charset'], $GLOBALS['_CFG']['shop_name']);
}
$charset = $GLOBALS['_CFG']['mail_charset'];
Include_once ROOT_PATH . 'includes/phpmailer/class.phpmailer.php';
$mail = new PHPMailer();
$mail->From = $GLOBALS['_CFG']['smtp_user'];
$mail->FromName = 'Yunnan *** Broadcasting Co., Ltd.';
If ($GLOBALS['_CFG']['mail_service'] == 0) {
          $mail->isMail();
} else {
          $mail->IsSMTP();
         $mail->Host = $GLOBALS['_CFG']['smtp_host'];
         $mail->Port = $GLOBALS['_CFG']['smtp_port'];
         $mail->SMTPAuth = !empty($GLOBALS['_CFG']['smtp_pass']);
$mail->Username = $GLOBALS['_CFG']['smtp_user'];
         $mail->Password = $GLOBALS['_CFG']['smtp_pass'];
}
$mail->Encoding = "base64";
//$mail->Priority = $this->priority;
$mail->CharSet = $charset;
$mail->IsHTML($type);
$mail->Subject = $subject;
$mail->Body = $content;
$mail->Timeout = 30;
$mail->SMTPDebug = false;
$mail->ClearAddresses();
$mail->AddAddress($email, $name);
$mail->ConfirmReadingTo = $notification;
$res = $mail->Send();
If (!$res)
{
$GLOBALS['err']->add($mail->ErrorInfo);
          $GLOBALS['err']->add($GLOBALS['_LANG']['sendemail_false']);
         return false;
}
Return true;
}

The above is the entire content of this article, I hope you guys will like it.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/953148.htmlTechArticleecshop implements smtp to send emails, ecshopsmtp sends emails. When using ECShop's smtp method to send emails, in the cls_smtp class file, Execute the statement in the get_data method: Copy the code code such as...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP methods and steps for sending emails to multiple people using PHPMailer PHP methods and steps for sending emails to multiple people using PHPMailer May 22, 2023 pm 06:10 PM

In web applications, it is often necessary to send emails to multiple recipients at once. PHP is a very popular web development language, and PHPMailer is a common PHP class library for sending emails. PHPMailer provides a rich interface, making sending emails in PHP applications more convenient and easy to use. In this article, we will introduce the methods and steps on how to use PHPMailer to send emails to multiple recipients. To download PHPMailer, you first need to go to the official website (

PHP development practice: Use PHPMailer to send emails to users in the MySQL database PHP development practice: Use PHPMailer to send emails to users in the MySQL database Aug 05, 2023 pm 06:21 PM

PHP development practice: Use PHPMailer to send emails to users in the MySQL database Introduction: In the construction of the modern Internet, email is an important communication tool. Whether it is user registration, password reset, or order confirmation in e-commerce, sending emails is an essential function. This article will introduce how to use PHPMailer to send emails and save the email information to the user information table in the MySQL database. 1. Install the PHPMailer library PHPMailer is

How to disable smtp email function in php How to disable smtp email function in php Mar 22, 2023 pm 03:22 PM

PHP is a powerful programming language that is widely used in the field of Web development. The SMTP email function is also an important part of PHP development. However, in some cases, you may want to disable SMTP mail functionality, and this article will explain how to do this.

How to send email using Flask-Mail How to send email using Flask-Mail Aug 02, 2023 am 10:17 AM

How to use Flask-Mail to send emails With the development of the Internet, email has become an important tool for people to communicate. When developing web applications, sometimes we need to send emails in specific scenarios, such as sending a welcome email after a user successfully registers, or sending a password reset email when a user forgets their password, etc. Flask is a simple and flexible Python Web framework, and Flask-Mail is an extension library for sending emails under the Flask framework. This article will introduce how to

Python connects to Alibaba Cloud interface to implement email sending function Python connects to Alibaba Cloud interface to implement email sending function Jul 05, 2023 pm 04:33 PM

Python connects to the Alibaba Cloud interface to implement the email sending function. Alibaba Cloud provides a series of service interfaces, including email sending services. By connecting to the Alibaba Cloud interface through a Python script, we can quickly send emails. This article will show you how to use Python scripts to connect to the Alibaba Cloud interface and implement the email sending function. First, we need to apply for the email sending service on Alibaba Cloud and obtain the corresponding interface information. In the Alibaba Cloud Management Console, select the email push service and create a new email

What are the methods for sorting ecshop articles? What are the methods for sorting ecshop articles? Jun 16, 2023 am 11:30 AM

How to sort ecshop articles: 1. Sort by publication time, you can control the order of articles in the list by modifying the publication time of the article; 2. Sort by clicks, you can achieve this sorting by installing the "Article Click Ranking" plug-in Function, this plug-in can count the number of clicks on articles; 3. Sort by the number of comments, you can implement this sorting function by installing the "Article Comment Ranking" plug-in, which can count the number of comments on articles; 4. Sort by relevance, This sorting function can be achieved by installing the "Search Ranking" plug-in.

What is the architecture of ecshop? What is the architecture of ecshop? Feb 23, 2023 am 09:32 AM

ecshop is a "B2C" architecture; ecshop is a B2C independent online store system, suitable for enterprises and individuals to quickly build personalized online stores; the system is a cross-platform open source program developed based on PHP language and MYSQL database architecture.

How to use PHP to implement email communication based on SMTP protocol How to use PHP to implement email communication based on SMTP protocol Jul 30, 2023 pm 04:45 PM

How to use PHP to implement email communication based on SMTP protocol. With the popularity of the Internet, email has become an indispensable part of people's daily life and work. In PHP, we can use the SMTP (SimpleMailTransferProtocol) protocol to send and receive emails. This article will introduce how to use PHP to implement email communication based on the SMTP protocol, and come with relevant code examples. To reference the SMTP class library, we need to use the SMTP protocol.

See all articles