[Html]
1. <span style = "font-size: 18px;"> instance: </span>
[Html]
1. $ content = "ceshi ";
2. $ technicalemail = "www.2cto.com ";
3. $ headers = "From: =? UTF-8? B? ". Base64_encode ('chenglong ')."? = <$ Technicalemail> \ r \ n ";
4.
5. $ content = strip_tags ($ content );
6. $ a = @ mail ($ technicalemail, '=? UTF-8? B? '. Base64_encode ('error committing ').'? = ', $ Content, $ headers );
7. if ($)
8 .{
9. echo: the email is sent successfully! ';
10 .}
Send via mail () function:
1. You need to configure the php. ini email information.
Open the php. ini configuration file and configure the red location.
; For Win32 only.
SMTP = localhost --- If sendmail is installed on the local machine, this indicates using the local email server, IP address, and server domain name.
Smtp_port = 25 --- port number
; For Win32 only.
; Sendmail_from = www.2cto.com --- write or not. Remove the semicolon here.
; For Unix only. You may supply arguments as well (default: "sendmail-t-I ").
; Sendmail_path = ---- mail server path
2. mail () function
The mail () function allows direct email sending from scripts.
The mail () function returns a boolean value. If the return value is successful, the return value is true. If the return value is failed, the return value is flase.
Mail (to, subject, message, headers, paeameters );
To -- required, specifying the recipient of the email
Subject -- required, specifies the subject of the email. This parameter cannot contain any line feed characters
Message -- required, specifying the message to be sent
Headers -- Optional. specify additional headers, such as from, Cc, and Bcc. For more information, see
Parameters -- optional, specifying additional parameters of the sendmail Program
3. in php. ini, remove ";" before extension = php_imap.dll.
Author: Vericlongmore