![](/img/trans.png)
[英]Set Google Account on Server side without showing dialog for account selection
[英]how can we set google app account set with server
我正在嘗試通過谷歌應用從我的服務器發送郵件。
我正在使用這個 php 代碼:-
$to = "username@gmail.com";
$header = "From: username@netvigator.com";
$subject = "testing mail";
$message = "no reply pls";
ini_set("SMTP","smtp.gmail.com");
ini_set("SMTP_PORT", 23);
ini_set("sendmail_from","username@fullpiracy.com");
ini_set("auth_username","username@fullpiracy.com");
ini_set("auth_password","password");
mail($to, $subject, $message, $header);
提前致謝 !
這是通過發送郵件開源庫完成的。
我相信 Gmail 使用 SSL(或 TLS),所以你應該相應地調整你的設置。
The port is usually 465 for ssl connection and 587 for TLS, and address are ssl://smtp.gmail.com
and tls://smtp.gmail.com
respectively.
這是一個有用的 SO 問題的鏈接,可能會有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.