[Html] 1. & lt; spanstyle & quot; font-size: 18px; & quot; & gt; instance: & lt;/span & gt; [html] 1. $ content & quot; ceshi & quot; 2. $ technicalemail & quot; www.2cto.com & quot; 3. $ headers
[Html]
1. instance:
[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