Tại sao bạn nên cài SMTP bằng code?
- Các plugin thường đi kèm với nhiều tính năng không cần thiết (chẳng hạn như quảng cáo), có thể gây ảnh hưởng tới hiệu suất của website.
- Một số plugin có khả năng bảo mật không tốt, có thể trở thành nguyên nhân khiến website của bạn bị hack.
- Cấu hình SMTP bằng code khá đơn giản, bất cứ ai cũng có thể làm được.
Hướng dẫn cài đặt
Các bạn thay lại các thông tin theo đúng mail của mình. Sau đó mở file functions.php
của theme hoặc child-theme mà bạn đang sử dụng ra và chèn đoạn code sau đây vào bên trong, lưu lại và kiểm tra kết quả bằng cách điền form, đặt hàng,…
- Thay
admin@gmail.com
bằng địa chỉ email dùng đăng ký tài khoản SMTP của bạn. Nếu bạn dùng SMTP của Gmail thì nó chính là địa chỉ Gmail. - Thay
jhitefkutfpzdiqw
bằng mật khẩu đăng nhập tài khoản SMTP. Nếu tài khoản có bật bảo mật 2 bước thì các bạn cần phải điền mật khẩu ứng dụng thay vì mật khẩu đăng nhập. - Thay
smtp.gmail.com
bằng địa chỉ server SMTP của bạn. Nếu bạn dùng SMTP của Gmail thì địa chỉ sẽ làsmtp.gmail.com
. - Thay
admin@gmail.com
bằng địa chỉ email mà bạn muốn dùng để gửi mail (tùy ý). Nó có thể là email với tên miền riêng (mail domain) hoặc địa chỉ Gmail của bạn. - Thay
Brand Name
bằng tên người gửi. Nó có thể là tên công ty của bạn hoặc tên bạn (tùy ý). - Thay
465
bằng port SMTP. Các bạn có thể dùng port465
,587
hoặc25
, tùy vào từng nhà cung cấp hosting. - Thay
ssl
bằng giao thức mã hóa phù hợp. Nếu bạn dùng port465
thì điềnssl
, còn nếu dùng port587
hoặc25
thì điềntls
.
Các bạn nên chèn code vào child-theme để tránh trường hợp mất code khi update theme nhé!
/** Cài SMTP **/ add_action( 'phpmailer_init', function( $phpmailer ) { if ( !is_object( $phpmailer ) ) $phpmailer = (object) $phpmailer; $phpmailer->Mailer = 'smtp'; $phpmailer->Host = 'smtp.gmail.com'; $phpmailer->SMTPAuth = 1; $phpmailer->Port = 587; $phpmailer->Username = 'admin@gmail.com'; //điền tài khoản gmail của bạn $phpmailer->Password = 'jhitefkutfpzdiqw'; //điền mật khẩu ứng dụng mà bạn đã tạo ở trên $phpmailer->SMTPSecure = 'TLS'; $phpmailer->From = 'admin@gmail.com'; //điền tài khoản gmail của bạn $phpmailer->FromName = 'Brand Name'; });
Chúc các bạn thành công!
https://bezmotora72.ru/club/user/4883/blog/9598/
https://honda-fit.ru/forums/index.php?autocom=gallery&req=si&img=7124
https://vitz.ru/forums/index.php?autocom=gallery&req=si&img=4904
https://honda-fit.ru/forums/index.php?autocom=gallery&req=si&img=7101
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4611
https://vitz.ru/forums/index.php?autocom=gallery&req=si&img=5006
http://toyota-porte.ru/forums/index.php?autocom=gallery&req=si&img=3349
https://honda-fit.ru/forums/index.php?autocom=gallery&req=si&img=7078
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4591
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4605
https://vitz.ru/forums/index.php?autocom=gallery&req=si&img=4854
http://toyota-porte.ru/forums/index.php?autocom=gallery&req=si&img=3252
https://myteana.ru/forums/index.php?autocom=gallery&req=si&img=6650
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4587
https://vitz.ru/forums/index.php?autocom=gallery&req=si&img=5066
http://wish-club.ru/forums/index.php?autocom=gallery&req=si&img=5489
https://honda-fit.ru/forums/index.php?autocom=gallery&req=si&img=7336
https://mazda-demio.ru/forums/index.php?autocom=gallery&req=si&img=6626
https://mazda-demio.ru/forums/index.php?autocom=gallery&req=si&img=6364
https://hrv-club.ru/forums/index.php?autocom=gallery&req=si&img=6959
https://mazda-demio.ru/forums/index.php?autocom=gallery&req=si&img=6425
https://myteana.ru/forums/index.php?autocom=gallery&req=si&img=6694
https://myteana.ru/forums/index.php?autocom=gallery&req=si&img=6698
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4698
http://wish-club.ru/forums/index.php?autocom=gallery&req=si&img=5399
https://mazda-demio.ru/forums/index.php?autocom=gallery&req=si&img=6585
Светлана Лобода – Новый Рим скачать и слушать онлайн https://shorturl.fm/e8kAb
Rasa – Пчеловод скачать и слушать песню https://shorturl.fm/3hBeI
JONY – Аллея скачать и слушать онлайн https://shorturl.fm/cO2rj
Onika – Ищу любовь (Demeter Remix) скачать и слушать песню бесплатно https://shorturl.fm/Jl9hC
Света – Твои Глаза ( 2001 ) скачать mp3 и слушать бесплатно https://shorturl.fm/WxdF4
Cali – Взять взять скачать и слушать mp3 https://shorturl.fm/lSxnj
Artik & Asti, Артём Качер – Грустный дэнс скачать песню в mp3 и слушать онлайн https://shorturl.fm/VgNu5
https://vitz.ru/forums/index.php?autocom=gallery&req=si&img=4997
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4772
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4643
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4860
http://wish-club.ru/forums/index.php?autocom=gallery&req=si&img=5402
https://hrv-club.ru/forums/index.php?autocom=gallery&req=si&img=7056
http://terios2.ru/forums/index.php?autocom=gallery&req=si&img=4621
http://wish-club.ru/forums/index.php?autocom=gallery&req=si&img=5376
Тайпан Feat. & Il’giz – Пацан С Района скачать и слушать онлайн https://shorturl.fm/C48OH
Брызги – Не волнуйтесь, тётя! скачать mp3 и слушать онлайн бесплатно https://shorturl.fm/EcmeE
ASERT – Хуракан скачать mp3 и слушать онлайн бесплатно https://shorturl.fm/DmDGc
Надя Чернова – Май скачать mp3 и слушать бесплатно https://shorturl.fm/AwbXA
Boombitto – Вредная скачать mp3 и слушать онлайн бесплатно https://shorturl.fm/EK3WF
Roman Donskoy – Глубина скачать mp3 и слушать бесплатно https://shorturl.fm/0J9EU
Onegette & Feelghost – Из чёрного пепла скачать и слушать онлайн https://shorturl.fm/1VgTK
Anik Feat. & Ignat Izotov – Больше Никогда скачать mp3 и слушать онлайн бесплатно https://shorturl.fm/IxfPn