After you build a website, you may think of regular backup or manual backup of databases and files for security purposes. In fact, we can store the database files and website-related files we need through our mailbox. The large capacity of the mailbox and the ability to store attachments determine that we can try to send database files and website files as attachments.
After you build a website, you may think of regular backup or manual backup of databases and files for security purposes. In fact, we can store the database files and website-related files we need through our mailbox. The large capacity of the mailbox and the ability to store attachments determine that we can try to send database files and website files as attachments.
After you build a website, you may think of regular backup or manual backup of databases and files for security purposes. In fact, we can store the database files and website-related files we need through our mailbox. The large capacity of the mailbox and the ability to store attachments determine that we can try to store database files and website files as attachments to the specified mailbox to complete the backup task. Let's take a look at how we can send emails with attachments through the mail component of php.
'?.? "\ R \ n ";? ?? $ Headers ?. =? 'From :? '. $ From [0].'? <'. $ From [1].'> '?.? "\ R \ n ";? ?? // What is the main content of the email (HTML supported )?? $ Message? =? 'This is the information of an HTML Tag. He sent you the attachment you needed !! '. "\ N ".? ?? "-- {$ Mime_boundary} \ n "?.? ?? "Content-Type: text/html ;? Charset = \ "UTF-8 \" \ n "?.? ?? "Content-Transfer-Encoding :? 7bit \ n "?.? ?? $ Message ?.? "\ N ";? ?? // Configure the attachment :? ?? $ Name? =? 'Itluren.jpg ';? ?? //? The? Path? To? The? Image? With? The? File? Name :? ?? $ Fileatt? =? "Images/". $ name ;? ?? $ Fileatt_type? =? "Application/octet-stream ";? // File type ?? // Change the file name to the attachment name ?? $ Fileatt_name? =? $ Name ;?? ?? // Read related files? ?? $ File? =? Fopen ($ fileatt, 'rb ');? ?? $ Data? =? Fread ($ file, filesize ($ fileatt ));? ?? Fclose ($ file );?? ?? // What is the conversion size? ?? $ Data? =? Chunk_split (base64_encode ($ data ));?? // Add the attachment ?? $ Message ?. =? "-- {$ Mime_boundary} \ n "?.? ?? "Content-Type :? {$ Fileatt_type}; \ n "?.? ?? "? Name = \ "{$ fileatt_name} \" \ n "?.? ?? "Content-Transfer-Encoding :? Base64 \ n "?.? ?? $ Data ?.? "\ N "?.? ?? "-- {$ Mime_boundary} \ n ";? ?? Unset ($ data );? ?? Unset ($ file );? ?? Unset ($ fileatt );? ?? Unset ($ fileatt_type );? ?? Unset ($ fileatt_name );? ?? // Start sending birds ?? Mail ($ to [1],? $ Subject ,? $ Message ,? $ Headers );? ???> ??
If you are interested and want to make it more convenient, you can add a regular automatic transmission, and work with the creation of the compressed package and database backup files, we can let the website automatically complete the database and file backup.
Statement: This article uses BY-NC-SA protocol for authorization | IT passers-
Reprinted please note