在打开时自动发送带有php数据的电子邮件

时间:2017-01-23 18:30:29

标签: php email

我想在打开网页时自动向mydelf发送包含生成的php数据的电子邮件。这有可能吗?

$string ='"'.$QUERY_STRING.'","' // everything after "?" in the URL
  .$_SERVER['REMOTE_ADDR'].'","' // ip address
  .$hostname.'","' // hostname
  .$_SERVER['HTTP_USER_AGENT'].'","' // browser and operating system
  .$_SERVER['HTTP_REFERER'].'","' // where they got the link for this page
  .$details->loc.'","' // latitude, longitude
  .$details->org.'","' // internet service provider
  .$details->city.'","'  // city
  .$details->region.'","' // state
  .$details->country.'","' // country
  .date("D dS M,Y h:i a").'"' // date
  ."\n"
  ;

1 个答案:

答案 0 :(得分:-1)

您可以使用php Mail功能

http://php.net/manual/en/function.mail.php

但是你可能会更好地使用PHPMailer

https://github.com/PHPMailer/PHPMailer