简体   繁体   English

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

[英]Automatically send email with php data on opening

I want to Automatically send mydelf an email containing the generated php data on opening of the webpage.我想在打开网页时自动向 mydelf 发送一封电子邮件,其中包含生成的 php 数据。 is this possible?这可能吗?

$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"
  ;

You can use the php Mail function可以使用php邮件功能

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

But you would probably be better off with PHPMailer但是使用 PHPMailer 可能会更好

https://github.com/PHPMailer/PHPMailer https://github.com/PHPMailer/PHPMailer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM