PHP Send Email

2017 May 19 at 5:04 pm Leave a comment

Cukup mudah jika kita mau kirim email via PHP,
Contoh Kirim email sederhana

<?php
// Pesan email
$msg = “Coba Send Email via PHP”;
if(mail(“someone@example.com”,”Test Via PHP”,$msg)){
echo “The email($email_subject) was successfully sent.”;
}else{
echo “The email($email_subject) was NOT sent.”;
}

?>

Persaratan:
Server harus dinstall dulu sendmail
sudo apt-get install sendmail
untuk ngetest server kita sudah bisa kirim email, jalankan perintah Linux sbb.
$ echo “Subject: sendmail test” | sendmail -v email.kita@domain.com

Advertisements

Entry filed under: PHP.

Setting Port pada Arduino

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Categories


%d bloggers like this: