{"id":652181,"date":"2025-08-13T00:04:24","date_gmt":"2025-08-12T16:04:24","guid":{"rendered":"http:\/\/puo.cn\/?p=652181"},"modified":"2025-08-13T00:38:14","modified_gmt":"2025-08-12T16:38:14","slug":"%e5%88%a9%e7%94%a8cloudflare%e6%90%ad%e5%bb%ba%e9%82%ae%e7%ae%b1%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"http:\/\/puo.cn\/?p=652181","title":{"rendered":"\u5229\u7528Cloudflare\u642d\u5efa\u90ae\u7bb1\u7cfb\u7edf"},"content":{"rendered":"<p>\u63d0\u8bf4Cloudflare\u4f01\u4e1a\u90ae\u7bb1\u6bd4\u8f83\u597d\uff0c\u5c31\u8feb\u4e0d\u53ca\u5f85\u7684\u60f3\u642d\u5efa\u4e86\u00a0 \u00a0\u5b66\u4e60\u6559\u7a0b\uff1a\u767d\u5ad6cloudflare\u65e0\u9650\u591a\u4f01\u4e1a\u90ae\u7bb1\uff0c\u53ef\u6536\u53d1\u90ae\u4ef6\u00a0 \u89c1<a rel=\"nofollow\" href=\"https:\/\/youtube.com\/watch?v=smWrAZq_2Fg&amp;si=4JDlWc3JfooO8Wtg\" target=\"_blank\" rel=\"noopener\">\u94fe\u63a5<\/a><\/p>\n<h3>\u63a5\u6536<\/h3>\n<p>\u9009\u4e86\u4e00\u4e2a\u597d\u7684\u57df\u540d hcwl.com\u4f5c\u4e3a\u6d4b\u8bd5<\/p>\n<p>\u5f88\u5feb\u5728Cloudflare\u89e3\u6790\u597d\u4e86\uff0c \u53ef\u4ee5\u7ed9 *@hcwl.com\u4e0b\u6240\u6709\u90ae\u7bb1\u53d1\u9001\u90ae\u4ef6\u4e86\uff0c\u7528QQ\u90ae\u7bb1\u505a\u4e86\u8f6c\u63a5\u6536<\/p>\n<p>\u8fd9\u6837cloudflare mail\u7684\u63a5\u6536\u7cfb\u7edf\u5c31\u597d\u4e86<\/p>\n<h3>\u53d1\u9001<\/h3>\n<p>\u7136\u540e\u7528https:\/\/resend.com\/\u00a0 \u91cc\u9762\u7684email\u642d\u5efa\u4e86\u53d1\u9001\u7cfb\u7edf\uff0c github\u8d26\u53f7\u767b\u9646\u4e86\uff0c\u8bbe\u7f6e\u4e86\u57df\u540d\uff0c\u7ed1\u5b9a\u4e86mx\uff0ctxt\u76f8\u5173\u4fe1\u606f<\/p>\n<p>&nbsp;<\/p>\n<p>\u6709\u4e00\u4e2aapi \u79d8\u94a5 \u5728\u6211\u55b5\u8bb0\u91cc\u9762<\/p>\n<p><a rel=\"nofollow\" href=\"https:\/\/resend.com\/docs\/send-with-smtp\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-652194\" title=\"20250813003431834\" src=\"http:\/\/loc-wp-cdnimg.jiyun.net\/blogtest\/2025\/08\/20250813003431834.png\" alt=\"20250813003431834\" width=\"702\" height=\"453\" srcset=\"http:\/\/loc-wp-cdnimg.jiyun.net\/blogtest\/2025\/08\/20250813003431834.png 702w, http:\/\/loc-wp-cdnimg.jiyun.net\/blogtest\/2025\/08\/20250813003431834-300x194.png 300w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/a><\/p>\n<p>\u7136\u540e\u7adf\u7136\u8ba9\u6211\u7528\u4ee3\u7801\u53d1\u90ae\u4ef6\uff0c\u8fd9\u4e2a\u6211\u4e0d\u4f1a\u4ee3\u7801\u5440\uff0c\u771f\u7684\u5f88\u65e0\u52a9\u5440\uff0c\u5c31\u95ee\u4e86AI<\/p>\n<p>ai\u8bf4\uff1a\u90a3\u6211\u7ed9\u4f60\u8bbe\u8ba1\u4e00\u4e2a <strong data-start=\"11\" data-end=\"46\">Resend \u90ae\u4ef6\u7f51\u9875\u7248\u540e\u53f0\uff08\u5e26 Excel \u6279\u91cf\u53d1\u90ae\u4ef6\u529f\u80fd\uff09<\/strong> \u7684\u65b9\u6848\uff0c\u4fdd\u8bc1\u4f60\u7528\u8d77\u6765\u5c31\u50cf\u7528\u666e\u901a\u90ae\u4ef6\u7cfb\u7edf\u4e00\u6837\u7b80\u5355<\/p>\n<h2 data-start=\"80\" data-end=\"90\">\u00a0\u529f\u80fd\u8bbe\u8ba1<\/h2>\n<ol data-start=\"91\" data-end=\"322\">\n<li data-start=\"91\" data-end=\"156\">\n<p data-start=\"94\" data-end=\"106\"><strong data-start=\"94\" data-end=\"104\">\u5355\u5c01\u90ae\u4ef6\u53d1\u9001<\/strong><\/p>\n<ul data-start=\"110\" data-end=\"156\">\n<li data-start=\"110\" data-end=\"143\">\n<p data-start=\"112\" data-end=\"143\">\u5728\u7f51\u9875\u4e0a\u8f93\u5165\u6536\u4ef6\u4eba\u3001\u4e3b\u9898\u3001\u6b63\u6587\uff08\u652f\u6301 HTML \u548c\u7eaf\u6587\u672c\uff09<\/p>\n<\/li>\n<li data-start=\"147\" data-end=\"156\">\n<p data-start=\"149\" data-end=\"156\">\u53ef\u4e0a\u4f20\u9644\u4ef6<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li data-start=\"157\" data-end=\"241\">\n<p data-start=\"160\" data-end=\"176\"><strong data-start=\"160\" data-end=\"174\">Excel \u6279\u91cf\u7fa4\u53d1<\/strong><\/p>\n<ul data-start=\"180\" data-end=\"241\">\n<li data-start=\"180\" data-end=\"208\">\n<p data-start=\"182\" data-end=\"208\">\u4e0a\u4f20\u4e00\u4e2a Excel \u6587\u4ef6\uff08\u6536\u4ef6\u4eba\u3001\u4e3b\u9898\u3001\u6b63\u6587\uff09<\/p>\n<\/li>\n<li data-start=\"212\" data-end=\"241\">\n<p data-start=\"214\" data-end=\"241\">\u7cfb\u7edf\u81ea\u52a8\u6309\u884c\u8bfb\u53d6\u5e76\u8c03\u7528 Resend API \u53d1\u9001<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li data-start=\"242\" data-end=\"286\">\n<p data-start=\"245\" data-end=\"255\"><strong data-start=\"245\" data-end=\"253\">\u53d1\u9001\u8bb0\u5f55<\/strong><\/p>\n<ul data-start=\"259\" data-end=\"286\">\n<li data-start=\"259\" data-end=\"286\">\n<p data-start=\"261\" data-end=\"286\">\u6bcf\u6b21\u53d1\u9001\u7684\u7ed3\u679c\u4fdd\u5b58\u5728\u65e5\u5fd7\u4e2d\uff0c\u53ef\u4ee5\u67e5\u770b\u6210\u529f\/\u5931\u8d25<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li data-start=\"287\" data-end=\"322\">\n<p data-start=\"290\" data-end=\"302\"><strong data-start=\"290\" data-end=\"300\">\u8bbf\u95ee\u5bc6\u7801\u4fdd\u62a4<\/strong><\/p>\n<ul data-start=\"306\" data-end=\"322\">\n<li data-start=\"306\" data-end=\"322\">\n<p data-start=\"308\" data-end=\"322\">\u9632\u6b62\u522b\u4eba\u4e71\u7528\u4f60\u7684\u90ae\u4ef6\u989d\u5ea6<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h2 data-start=\"329\" data-end=\"339\">\u6280\u672f\u65b9\u6848<\/h2>\n<ul data-start=\"340\" data-end=\"556\">\n<li data-start=\"340\" data-end=\"373\">\n<p data-start=\"342\" data-end=\"373\"><strong data-start=\"342\" data-end=\"348\">\u8bed\u8a00<\/strong>\uff1aPHP\uff08\u4e0d\u7528\u989d\u5916\u5b89\u88c5\u4e1c\u897f\uff0c\u5927\u90e8\u5206\u4e3b\u673a\u90fd\u652f\u6301\uff09<\/p>\n<\/li>\n<li data-start=\"374\" data-end=\"412\">\n<p data-start=\"376\" data-end=\"412\"><strong data-start=\"376\" data-end=\"384\">\u4e0a\u4f20\u76ee\u5f55<\/strong>\uff1a<code data-start=\"385\" data-end=\"395\">uploads\/<\/code>\uff08\u5b58\u9644\u4ef6\u548c Excel \u6587\u4ef6\uff09<\/p>\n<\/li>\n<li data-start=\"413\" data-end=\"495\">\n<p data-start=\"415\" data-end=\"495\"><strong data-start=\"415\" data-end=\"427\">Excel \u89e3\u6790<\/strong>\uff1a\u7528 <a rel=\"nofollow\" class=\"\" href=\"https:\/\/github.com\/PHPOffice\/PhpSpreadsheet\" target=\"_new\" rel=\"noopener\" data-start=\"430\" data-end=\"491\">PhpSpreadsheet<\/a> \u5e93<\/p>\n<\/li>\n<li data-start=\"496\" data-end=\"531\">\n<p data-start=\"498\" data-end=\"531\"><strong data-start=\"498\" data-end=\"506\">\u53d1\u9001\u63a5\u53e3<\/strong>\uff1aResend \u5b98\u65b9 API\uff08cURL \u8c03\u7528\uff09<\/p>\n<\/li>\n<li data-start=\"532\" data-end=\"556\">\n<p data-start=\"534\" data-end=\"556\"><strong data-start=\"534\" data-end=\"540\">\u754c\u9762<\/strong>\uff1a\u7b80\u5355\u8868\u5355 + \u6587\u4ef6\u4e0a\u4f20\u63a7\u4ef6<\/p>\n<\/li>\n<\/ul>\n<h2>\u6587\u4ef6\u7ed3\u6784<\/h2>\n<p>\/resend-mail\/<br \/>\n\u251c\u2500\u2500 index.php # \u7f51\u9875\u524d\u7aef\u548c\u53d1\u9001\u5904\u7406<br \/>\n\u251c\u2500\u2500 send_excel.php # \u6279\u91cf\u53d1\u9001\u5904\u7406<br \/>\n\u251c\u2500\u2500 uploads\/ # \u4e0a\u4f20\u7684\u6587\u4ef6\u5b58\u653e\u76ee\u5f55<br \/>\n\u251c\u2500\u2500 vendor\/ # PhpSpreadsheet \u5e93<\/p>\n<div class=\"relative flex h-full w-full flex-row\">\n<div class=\"relative flex h-full max-w-full flex-1 flex-col\">\n<div id=\"thread\" class=\"group\/thread @container\/thread h-full w-full\">\n<div class=\"composer-parent flex h-full flex-col focus-visible:outline-0 overflow-hidden\" role=\"presentation\">\n<div class=\"relative flex basis-auto flex-col -mb-(--composer-overlap-px) [--composer-overlap-px:28px] grow overflow-hidden\">\n<div class=\"relative h-full\">\n<div class=\"flex h-full flex-col overflow-y-auto [scrollbar-gutter:stable_both-edges] @[84rem]\/thread:pt-(--header-height)\">\n<div class=\"@thread-xl\/thread:pt-header-height flex flex-col text-sm pb-25\">\n<article class=\"text-token-text-primary w-full focus:outline-none scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]\" dir=\"auto\" tabindex=\"-1\" data-turn-id=\"request-WEB:24b2e2a5-3592-4623-b046-376897388eed-5\" data-testid=\"conversation-turn-12\" data-scroll-anchor=\"false\" data-turn=\"assistant\">\n<div class=\"text-base my-auto mx-auto [--thread-content-margin:--spacing(4)] @[37rem]:[--thread-content-margin:--spacing(6)] @[72rem]:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:32rem] @[34rem]:[--thread-content-max-width:40rem] @[64rem]:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group\/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn\" tabindex=\"-1\">\n<div class=\"flex max-w-full flex-col grow\">\n<div class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-5\" dir=\"auto\" data-message-author-role=\"assistant\" data-message-id=\"cdf72866-6de7-4593-89f6-8410faf45bd7\" data-message-model-slug=\"gpt-5\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[3px]\">\n<div class=\"markdown prose dark:prose-invert w-full break-words light markdown-new-styling\">\n<h2 data-start=\"746\" data-end=\"769\">\u00a0Excel \u6587\u4ef6\u683c\u5f0f\uff08UTF-8\uff09<\/h2>\n<div class=\"_tableContainer_1rjym_1\">\n<div class=\"_tableWrapper_1rjym_13 group flex w-fit flex-col-reverse\" tabindex=\"-1\">\n<table class=\"w-fit min-w-(--thread-content-width)\" data-start=\"770\" data-end=\"1062\">\n<thead data-start=\"770\" data-end=\"846\">\n<tr data-start=\"770\" data-end=\"846\">\n<th data-start=\"770\" data-end=\"791\" data-col-size=\"sm\">email<\/th>\n<th data-start=\"791\" data-end=\"805\" data-col-size=\"sm\">subject<\/th>\n<th data-start=\"805\" data-end=\"830\" data-col-size=\"sm\">html_content<\/th>\n<th data-start=\"830\" data-end=\"846\" data-col-size=\"sm\">text_content<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"923\" data-end=\"1062\">\n<tr data-start=\"923\" data-end=\"992\">\n<td data-start=\"923\" data-end=\"944\" data-col-size=\"sm\"><a class=\"cursor-pointer\" rel=\"noopener\" data-start=\"925\" data-end=\"942\">user1@example.com<\/a><\/td>\n<td data-col-size=\"sm\" data-start=\"944\" data-end=\"954\">\u6d4b\u8bd5\u90ae\u4ef61<\/td>\n<td data-col-size=\"sm\" data-start=\"954\" data-end=\"978\">&lt;b&gt;\u4f60\u597d1&lt;\/b&gt;<\/td>\n<td data-col-size=\"sm\" data-start=\"978\" data-end=\"992\">\u4f60\u597d1<\/td>\n<\/tr>\n<tr data-start=\"993\" data-end=\"1062\">\n<td data-start=\"993\" data-end=\"1014\" data-col-size=\"sm\"><a class=\"cursor-pointer\" rel=\"noopener\" data-start=\"995\" data-end=\"1012\">user2@example.com<\/a><\/td>\n<td data-col-size=\"sm\" data-start=\"1014\" data-end=\"1024\">\u6d4b\u8bd5\u90ae\u4ef62<\/td>\n<td data-col-size=\"sm\" data-start=\"1024\" data-end=\"1048\">&lt;b&gt;\u4f60\u597d2&lt;\/b&gt;<\/td>\n<td data-col-size=\"sm\" data-start=\"1048\" data-end=\"1062\">\u4f60\u597d2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2 data-start=\"1069\" data-end=\"1079\"><\/h2>\n<h2 data-start=\"1069\" data-end=\"1079\">\u4f7f\u7528\u6b65\u9aa4<\/h2>\n<ol data-start=\"1080\" data-end=\"1178\">\n<li data-start=\"1080\" data-end=\"1103\">\n<p data-start=\"1083\" data-end=\"1103\">\u4f60\u63d0\u4f9b Resend API Key<\/p>\n<\/li>\n<li data-start=\"1104\" data-end=\"1127\">\n<p data-start=\"1107\" data-end=\"1127\">\u6211\u5199\u597d\u540e\u53f0\u4ee3\u7801\u5e76\u5e2e\u4f60\u90e8\u7f72\u5230\u4f60\u7684\u670d\u52a1\u5668<\/p>\n<\/li>\n<li data-start=\"1128\" data-end=\"1145\">\n<p data-start=\"1131\" data-end=\"1145\">\u4f60\u76f4\u63a5\u8bbf\u95ee\u7f51\u5740\u5c31\u80fd\u53d1\u90ae\u4ef6<\/p>\n<\/li>\n<li data-start=\"1146\" data-end=\"1178\">\n<p data-start=\"1149\" data-end=\"1178\">\u6279\u91cf\u53d1\u90ae\u4ef6\u65f6\uff0c\u4e0a\u4f20 Excel \u6587\u4ef6 \u2192 \u7cfb\u7edf\u81ea\u52a8\u7fa4\u53d1<\/p>\n<\/li>\n<\/ol>\n<hr data-start=\"1180\" data-end=\"1183\" \/>\n<p data-start=\"1185\" data-end=\"1262\" data-is-last-node=\"\" data-is-only-node=\"\">\u5982\u679c\u4f60\u613f\u610f\uff0c\u6211\u53ef\u4ee5\u76f4\u63a5\u5e2e\u4f60\u5199\u597d\u8fd9\u4e2a\u7cfb\u7edf\u7684 <strong data-start=\"1206\" data-end=\"1218\">PHP \u5b8c\u6574\u4ee3\u7801<\/strong>\uff0c\u4f60\u53ea\u8981\u4e0a\u4f20\u5230\u670d\u52a1\u5668\u5c31\u80fd\u7528\u3002<br data-start=\"1232\" data-end=\"1235\" \/>\u8981\u6211\u76f4\u63a5\u7ed9\u4f60\u53d1\u8fd9\u4e2a\u6210\u54c1\u4ee3\u7801\u5417\uff1f\u8fd9\u6837\u4f60\u4eca\u5929\u5c31\u53ef\u4ee5\u7528\u4e0a\u4e86\u3002<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"flex min-h-[46px] justify-start\">\n<div class=\"touch:-me-2 touch:-ms-3.5 -ms-2.5 -me-1 flex flex-wrap items-center gap-y-4 p-1 select-none touch:w-[calc(100%+--spacing(3.5))] -mt-1 w-[calc(100%+--spacing(2.5))] duration-[1.5s] focus-within:transition-none hover:transition-none pointer-events-none [mask-image:linear-gradient(to_right,black_33%,transparent_66%)] [mask-size:300%_100%] [mask-position:100%_0%] motion-safe:transition-[mask-position] group-hover\/turn-messages:pointer-events-auto group-hover\/turn-messages:[mask-position:0_0] group-focus-within\/turn-messages:pointer-events-auto group-focus-within\/turn-messages:[mask-position:0_0] has-data-[state=open]:pointer-events-auto has-data-[state=open]:[mask-position:0_0]\"><\/div>\n<\/div>\n<div class=\"aria-live=polite absolute select-none\"><\/div>\n<\/div>\n<\/div>\n<\/article>\n<article class=\"text-token-text-primary w-full focus:outline-none scroll-mt-(--header-height)\" dir=\"auto\" tabindex=\"-1\" data-turn-id=\"6139c4d6-28b8-49c0-89f7-ff93038c2c4a\" data-testid=\"conversation-turn-13\" data-scroll-anchor=\"false\" data-turn=\"user\">\n<div class=\"text-base my-auto mx-auto pt-12 [--thread-content-margin:--spacing(4)] @[37rem]:[--thread-content-margin:--spacing(6)] @[72rem]:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:32rem] @[34rem]:[--thread-content-max-width:40rem] @[64rem]:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group\/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col\" tabindex=\"-1\">\n<div class=\"flex max-w-full flex-col grow\">\n<div class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-5\" dir=\"auto\" data-message-author-role=\"user\" data-message-id=\"6139c4d6-28b8-49c0-89f7-ff93038c2c4a\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden items-end rtl:items-start\">\n<div class=\"user-message-bubble-color relative max-w-[var(--user-chat-width,70%)] rounded-[18px] px-4 py-1.5 data-[multiline]:py-3\">\n<div class=\"whitespace-pre-wrap\">\n<p data-start=\"0\" data-end=\"143\">\u5df2\u51c6\u5907\u597d\u5b8c\u6574\u7684\u53ef\u90e8\u7f72\u4ee3\u7801\u5305\uff08\u5305\u542b <code data-start=\"17\" data-end=\"28\">index.php<\/code>\u3001<code data-start=\"29\" data-end=\"45\">send_excel.php<\/code>\u3001composer \u914d\u7f6e\u548c\u4f7f\u7528\u8bf4\u660e\uff09\u3002\u6211\u628a\u8fd9\u4e9b\u6587\u4ef6\u653e\u5728\u4e86\u753b\u5e03\uff08canvas\uff09\u91cc\uff0c\u6587\u4ef6\u540d\u662f <strong data-start=\"90\" data-end=\"118\">Resend-mail-php-complete<\/strong>\uff0c\u4f60\u53ef\u4ee5\u5728\u53f3\u4fa7\u7684\u6587\u4ef6\u9762\u677f\u91cc\u67e5\u770b\u3001\u590d\u5236\u6216\u4e0b\u8f7d\u5b83\u3002<\/p>\n<p data-start=\"145\" data-end=\"156\">\u5feb\u901f\u90e8\u7f72\u6b65\u9aa4\uff08\u6458\u8981\uff09\uff1a<\/p>\n<ol data-start=\"157\" data-end=\"507\">\n<li data-start=\"157\" data-end=\"213\">\n<p data-start=\"160\" data-end=\"213\">\u628a\u753b\u5e03\u91cc\u7684\u6587\u4ef6\u4e0a\u4f20\u5230\u4f60\u7684\u670d\u52a1\u5668\u76ee\u5f55\uff08\u4f8b\u5982 <code data-start=\"181\" data-end=\"209\">\/var\/www\/html\/resend-mail\/<\/code>\uff09\u3002<\/p>\n<\/li>\n<li data-start=\"214\" data-end=\"309\">\n<p data-start=\"217\" data-end=\"309\">\u5728\u8be5\u76ee\u5f55\u8fd0\u884c\uff1a<code data-start=\"224\" data-end=\"267\">composer require phpoffice\/phpspreadsheet<\/code>\uff08\u5982\u679c\u4e3b\u673a\u6ca1\u6709 Composer\uff0c\u6211\u53ef\u4ee5\u7ed9\u4e0d\u4f9d\u8d56 Composer \u7684\u7b80\u5316\u7248\uff09\u3002<\/p>\n<\/li>\n<li data-start=\"310\" data-end=\"373\">\n<p data-start=\"313\" data-end=\"373\">\u7f16\u8f91 <code data-start=\"316\" data-end=\"327\">index.php<\/code> \u9876\u90e8\u914d\u7f6e\uff1a\u586b\u5165\u4f60\u7684 <code data-start=\"338\" data-end=\"354\">Resend API Key<\/code>\u3001<code data-start=\"355\" data-end=\"361\">from<\/code> \u53d1\u4ef6\u4eba\u548c\u540e\u53f0\u5bc6\u7801\u3002<\/p>\n<\/li>\n<li data-start=\"374\" data-end=\"446\">\n<p data-start=\"377\" data-end=\"446\">\u521b\u5efa\u5e76\u8d4b\u6743 <code data-start=\"383\" data-end=\"393\">uploads\/<\/code>\uff1a<code data-start=\"394\" data-end=\"430\">mkdir uploads &amp;&amp; chmod 777 uploads<\/code>\uff08\u751f\u4ea7\u73af\u5883\u8bf7\u7528\u66f4\u4e25\u683c\u6743\u9650\uff09\u3002<\/p>\n<\/li>\n<li data-start=\"447\" data-end=\"507\">\n<p data-start=\"450\" data-end=\"507\">\u5728\u6d4f\u89c8\u5668\u6253\u5f00\uff1a<code data-start=\"457\" data-end=\"483\">http:\/\/\u4f60\u7684\u57df\u540d\/resend-mail\/<\/code>\uff0c\u767b\u5f55\u540e\u5c31\u80fd\u5355\u53d1\u6216\u4e0a\u4f20 Excel \u6279\u91cf\u53d1\u3002<\/p>\n<\/li>\n<\/ol>\n<p data-start=\"509\" data-end=\"519\">\u5982\u679c\u4f60\u5e0c\u671b\uff0c\u6211\u53ef\u4ee5\uff1a<\/p>\n<ul data-start=\"520\" data-end=\"636\">\n<li data-start=\"520\" data-end=\"559\">\n<p data-start=\"522\" data-end=\"559\">\u5e2e\u4f60\u628a\u4ee3\u7801\u90e8\u7f72\u5230\u4f60\u7684\u670d\u52a1\u5668\uff08\u9700\u8981 FTP\/SSH \u8bbf\u95ee\u6216\u4f60\u628a\u6587\u4ef6\u53d1\u7ed9\u6211\uff09\uff0c<\/p>\n<\/li>\n<li data-start=\"560\" data-end=\"610\">\n<p data-start=\"562\" data-end=\"610\">\u6216\u7ed9\u4e00\u4e2a<strong data-start=\"566\" data-end=\"582\">\u4e0d\u9700\u8981 Composer<\/strong> \u7684\u6781\u7b80\u7248\uff08\u6ca1\u6709 Excel \u529f\u80fd\uff0c\u4ec5\u5355\u5c01 + \u9644\u4ef6\uff09\uff0c<\/p>\n<\/li>\n<li data-start=\"611\" data-end=\"636\">\n<p data-start=\"613\" data-end=\"636\">\u6216\u628a\u754c\u9762\u7ffb\u6210\u4e2d\u6587\/\u7f8e\u5316\u6216\u589e\u52a0\u53d1\u9001\u65e5\u5fd7\u67e5\u770b\u9875\u9762\u3002<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"638\" data-end=\"698\" data-is-last-node=\"\" data-is-only-node=\"\">\u4f60\u60f3\u8981\u6211\u73b0\u5728<strong data-start=\"644\" data-end=\"652\">\u5e2e\u4f60\u90e8\u7f72<\/strong>\uff08\u6211\u9700\u8981\u4f60\u63d0\u4f9b\u4e3b\u673a\u8bbf\u95ee\u65b9\u5f0f\uff09\uff0c\u8fd8\u662f<strong data-start=\"669\" data-end=\"680\">\u5148\u8bd5\u7740\u81ea\u5df1\u90e8\u7f72<\/strong>\uff0c\u9047\u5230\u95ee\u9898\u628a\u9519\u8bef\u8d34\u7ed9\u6211\u6211\u6765\u5e2e\u4f60\u6392\u67e5\uff1f<\/p>\n<p data-start=\"638\" data-end=\"698\" data-is-last-node=\"\" data-is-only-node=\"\">\u6682\u5b9a\u6587\u4ef6\u540d\u79f0\u4e3a\uff1aresend_mail_php_complete.php<\/p>\n<p data-start=\"638\" data-end=\"698\" data-is-last-node=\"\" data-is-only-node=\"\">\u4ee3\u7801\u5982\u4e0b\uff0c\u76f8\u5173\u4e0b\u8f7dsmall-mail<br \/>\n\u94fe\u63a5: <a rel=\"nofollow\" href=\"https:\/\/pan.baidu.com\/s\/1x80By1IIqfs7t8B36dqKOA?pwd=234v\" target=\"_blank\" rel=\"noopener\">https:\/\/pan.baidu.com\/s\/1x80By1IIqfs7t8B36dqKOA?pwd=234v<\/a> \u63d0\u53d6\u7801: 234v\uff1a<\/p>\n<hr \/>\n<p>\/\/ File: README.md<br \/>\n# Resend \u90ae\u4ef6\u7f51\u9875\u7248\u540e\u53f0\uff08PHP\uff09<\/p>\n<p>\u5305\u542b\u6587\u4ef6\uff1a<br \/>\n&#8211; `index.php` \u2014\u2014 \u5355\u5c01\u53d1\u9001 &amp; \u6279\u91cf\u4e0a\u4f20\u8868\u5355\uff08\u4f1a\u8c03\u7528 `send_excel.php`\uff09<br \/>\n&#8211; `send_excel.php` \u2014\u2014 \u89e3\u6790 Excel \u5e76\u9010\u884c\u8c03\u7528 Resend API \u53d1\u9001<br \/>\n&#8211; `uploads\/` \u2014\u2014 \u4e0a\u4f20\u6587\u4ef6\u76ee\u5f55\uff08\u9700\u53ef\u5199\uff09<br \/>\n&#8211; `composer.json` \u2014\u2014 \u4f9d\u8d56\u8bf4\u660e\uff08PhpSpreadsheet\uff09<\/p>\n<p>&#8212;<\/p>\n<p>## \u5feb\u901f\u5f00\u59cb<br \/>\n1. \u5c06\u6574\u4e2a\u76ee\u5f55\u4e0a\u4f20\u5230\u4f60\u7684\u4e3b\u673a\uff08\u4f8b\u5982 `\/var\/www\/html\/resend-mail\/`\uff09\u3002<br \/>\n2. \u8fdb\u5165\u9879\u76ee\u76ee\u5f55\uff0c\u5b89\u88c5\u4f9d\u8d56\uff1a<\/p>\n<p>&#8220;`bash<br \/>\ncomposer require phpoffice\/phpspreadsheet<br \/>\n&#8220;`<\/p>\n<p>3. \u7f16\u8f91 `index.php` \u9876\u90e8\u7684\u914d\u7f6e\uff1a<br \/>\n&#8211; `$apiKey` \u586b\u5199\u4f60\u7684 Resend API Key\uff08`re_xxx`\uff09<br \/>\n&#8211; `$fromEmail` \u586b\u5199\u9a8c\u8bc1\u8fc7\u7684\u53d1\u4ef6\u4eba<br \/>\n&#8211; `$password` \u4fee\u6539\u4e3a\u4f60\u5e0c\u671b\u7684\u540e\u53f0\u8bbf\u95ee\u5bc6\u7801<\/p>\n<p>4. \u521b\u5efa\u5e76\u8d4b\u6743 uploads \u76ee\u5f55\uff1a<\/p>\n<p>&#8220;`bash<br \/>\nmkdir uploads<br \/>\nchmod 777 uploads<br \/>\n&#8220;`<\/p>\n<p>\uff08\u751f\u4ea7\u73af\u5883\u8bf7\u6539\u4e3a\u66f4\u4e25\u683c\u7684\u6743\u9650\uff0c\u4f8b\u5982 755\/750\uff0c\u5e76\u628a uploads \u653e\u5728\u4e0d\u53ef\u76f4\u63a5\u8bbf\u95ee\u7684\u8def\u5f84\u6216\u914d\u5408 .htaccess \u9650\u5236\uff09<\/p>\n<p>5. \u5728\u6d4f\u89c8\u5668\u6253\u5f00 `http:\/\/\u4f60\u7684\u57df\u540d\/resend-mail\/`\uff0c\u8f93\u5165\u5bc6\u7801\u5373\u53ef\u4f7f\u7528\u3002<\/p>\n<p>&#8212;<\/p>\n<p>\/\/ File: composer.json<br \/>\n{<br \/>\n&#8220;require&#8221;: {<br \/>\n&#8220;phpoffice\/phpspreadsheet&#8221;: &#8220;^1.29&#8221;<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ File: index.php<br \/>\n&lt;?php<br \/>\nrequire __DIR__ . &#8216;\/vendor\/autoload.php&#8217;; \/\/ \u53ea\u5728\u4f7f\u7528 Excel \u65f6\u9700\u8981\uff0c\u5b89\u5168\u8d77\u89c1\u653e\u5728\u9876\u90e8<\/p>\n<p>\/\/ ========== \u914d\u7f6e\u533a\uff08\u8bf7\u4fee\u6539\uff09 ============<br \/>\n$apiKey = &#8216;re_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#8217;; \/\/ &lt;&#8211; \u586b\u4f60\u7684 Resend API Key<br \/>\n$fromEmail = &#8216;Your Name &lt;you@yourdomain.com&gt;&#8217;; \/\/ &lt;&#8211; \u9a8c\u8bc1\u8fc7\u7684\u53d1\u4ef6\u4eba<br \/>\n$password = &#8216;changeme&#8217;; \/\/ &lt;&#8211; \u540e\u53f0\u8bbf\u95ee\u5bc6\u7801<br \/>\n$uploadDir = __DIR__ . &#8216;\/uploads\/&#8217;;<br \/>\n$logFile = $uploadDir . &#8216;send_log.csv&#8217;;<br \/>\n\/\/ ==========================================<\/p>\n<p>if (!file_exists($uploadDir)) {<br \/>\nmkdir($uploadDir, 0777, true);<br \/>\n}<\/p>\n<p>\/\/ \u8f85\u52a9\uff1a\u8bb0\u5f55\u65e5\u5fd7\uff08CSV\uff09<br \/>\nfunction log_result($to, $subject, $status, $response, $logFile) {<br \/>\n$line = [date(&#8216;Y-m-d H:i:s&#8217;), $to, $subject, $status, str_replace([&#8220;\\n&#8221;,&#8221;\\r&#8221;], [&#8216; &#8216;,&#8217; &#8216;], $response)];<br \/>\n$fp = fopen($logFile, &#8216;a&#8217;);<br \/>\nfputcsv($fp, $line);<br \/>\nfclose($fp);<br \/>\n}<\/p>\n<p>\/\/ \u53d1\u9001\u51fd\u6570\uff08\u8c03\u7528 Resend API\uff09<br \/>\nfunction send_via_resend($apiKey, $from, $toArray, $subject, $html, $text, $attachments=[]) {<br \/>\n$data = [<br \/>\n&#8216;from&#8217; =&gt; $from,<br \/>\n&#8216;to&#8217; =&gt; $toArray,<br \/>\n&#8216;subject&#8217; =&gt; $subject,<br \/>\n&#8216;html&#8217; =&gt; $html,<br \/>\n&#8216;text&#8217; =&gt; $text,<br \/>\n];<br \/>\nif (!empty($attachments)) $data[&#8216;attachments&#8217;] = $attachments;<\/p>\n<p>$ch = curl_init();<br \/>\ncurl_setopt($ch, CURLOPT_URL, &#8216;https:\/\/api.resend.com\/emails&#8217;);<br \/>\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br \/>\ncurl_setopt($ch, CURLOPT_POST, true);<br \/>\ncurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE));<br \/>\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [<br \/>\n&#8216;Content-Type: application\/json&#8217;,<br \/>\n&#8216;Authorization: Bearer &#8216; . $apiKey<br \/>\n]);<br \/>\n$response = curl_exec($ch);<br \/>\n$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);<br \/>\nif (curl_errno($ch)) {<br \/>\n$err = curl_error($ch);<br \/>\ncurl_close($ch);<br \/>\nreturn [ &#8216;ok&#8217; =&gt; false, &#8216;httpCode&#8217; =&gt; 0, &#8216;response&#8217; =&gt; $err ];<br \/>\n}<br \/>\ncurl_close($ch);<br \/>\nreturn [ &#8216;ok&#8217; =&gt; ($httpCode &gt;=200 &amp;&amp; $httpCode &lt;300), &#8216;httpCode&#8217; =&gt; $httpCode, &#8216;response&#8217; =&gt; $response ];<br \/>\n}<\/p>\n<p>\/\/ \u5982\u679c\u662f POST \u63d0\u4ea4\uff1a\u5904\u7406\u5355\u5c01\u53d1\u9001\u6216 Excel \u4e0a\u4f20\u8f6c\u53d1\u5230 send_excel.php<br \/>\nif ($_SERVER[&#8216;REQUEST_METHOD&#8217;] === &#8216;POST&#8217;) {<br \/>\n\/\/ \u7b80\u5355\u5bc6\u7801\u4fdd\u62a4<br \/>\nif (!isset($_POST[&#8216;password&#8217;]) || $_POST[&#8216;password&#8217;] !== $password) {<br \/>\ndie(&#8216;\u5bc6\u7801\u9519\u8bef&#8217;);<br \/>\n}<\/p>\n<p>\/\/ \u533a\u5206\u52a8\u4f5c<br \/>\n$action = $_POST[&#8216;action&#8217;] ?? &#8216;single&#8217;;<\/p>\n<p>if ($action === &#8216;single&#8217;) {<br \/>\n\/\/ \u5355\u5c01\u53d1\u9001<br \/>\n$toRaw = trim($_POST[&#8216;to&#8217;] ?? &#8221;);<br \/>\n$toList = array_map(&#8216;trim&#8217;, explode(&#8216;,&#8217;, $toRaw));<br \/>\n$subject = $_POST[&#8216;subject&#8217;] ?? &#8221;;<br \/>\n$html = $_POST[&#8216;html&#8217;] ?? &#8221;;<br \/>\n$text = $_POST[&#8216;text&#8217;] ?? &#8221;;<\/p>\n<p>\/\/ \u5904\u7406\u9644\u4ef6\u4e0a\u4f20\uff08\u5355\u5c01\uff09<br \/>\n$attachments = [];<br \/>\nif (!empty($_FILES[&#8216;attachments&#8217;]) &amp;&amp; !empty($_FILES[&#8216;attachments&#8217;][&#8216;tmp_name&#8217;][0])) {<br \/>\nforeach ($_FILES[&#8216;attachments&#8217;][&#8216;tmp_name&#8217;] as $idx =&gt; $tmpName) {<br \/>\nif (is_uploaded_file($tmpName)) {<br \/>\n$name = basename($_FILES[&#8216;attachments&#8217;][&#8216;name&#8217;][$idx]);<br \/>\n$target = $uploadDir . time() . &#8216;_&#8217; . $name;<br \/>\nmove_uploaded_file($tmpName, $target);<br \/>\n$attachments[] = [<br \/>\n&#8216;filename&#8217; =&gt; $name,<br \/>\n&#8216;content&#8217; =&gt; base64_encode(file_get_contents($target))<br \/>\n];<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>$result = send_via_resend($apiKey, $fromEmail, $toList, $subject, $html, $text, $attachments);<br \/>\n$status = $result[&#8216;ok&#8217;] ? &#8216;success&#8217; : &#8216;failed&#8217;;<br \/>\nlog_result(implode(&#8216;|&#8217;, $toList), $subject, $status, $result[&#8216;response&#8217;], $logFile);<\/p>\n<p>echo &#8220;&lt;h3&gt;\u53d1\u9001\u7ed3\u679c\uff1a&#8221; . htmlspecialchars($status) . &#8220;&lt;\/h3&gt;&#8221;;<br \/>\necho &#8220;&lt;pre&gt;HTTP: {$result[&#8216;httpCode&#8217;]}\\n&#8221; . htmlspecialchars($result[&#8216;response&#8217;]) . &#8220;&lt;\/pre&gt;&#8221;;<br \/>\necho &#8220;&lt;p&gt;&lt;a href=\\&#8221;{$_SERVER[&#8216;PHP_SELF&#8217;]}\\&#8221;&gt;\u8fd4\u56de&lt;\/a&gt;&lt;\/p&gt;&#8221;;<br \/>\nexit;<\/p>\n<p>} elseif ($action === &#8216;excel&#8217;) {<br \/>\n\/\/ \u8f6c\u53d1\u5230 send_excel.php \u5904\u7406\u6279\u91cf\uff08\u907f\u514d\u9875\u9762\u963b\u585e\u592a\u4e45\uff09<br \/>\n\/\/ \u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u5230 uploads \u5e76\u8c03\u7528 send_excel.php<br \/>\nif (empty($_FILES[&#8216;excel_file&#8217;]) || !is_uploaded_file($_FILES[&#8216;excel_file&#8217;][&#8216;tmp_name&#8217;])) {<br \/>\ndie(&#8216;\u672a\u4e0a\u4f20 Excel \u6587\u4ef6&#8217;);<br \/>\n}<br \/>\n$name = basename($_FILES[&#8216;excel_file&#8217;][&#8216;name&#8217;]);<br \/>\n$target = $uploadDir . time() . &#8216;_&#8217; . $name;<br \/>\nmove_uploaded_file($_FILES[&#8216;excel_file&#8217;][&#8216;tmp_name&#8217;], $target);<\/p>\n<p>\/\/ \u4f7f\u7528 GET \u4f20\u53c2\u5f88\u957f\u7684\u8bdd\u4f1a\u53d7\u9650\uff0c\u4f7f\u7528 POST \u8bf7\u6c42\u5185\u90e8\u8f6c\u53d1<br \/>\necho &#8220;&lt;h3&gt;\u6b63\u5728\u5f00\u59cb\u6279\u91cf\u53d1\u9001\uff0c\u9875\u9762\u4e0d\u4f1a\u5237\u65b0\u3002\u8bf7\u7b49\u5f85\u6216\u5728\u540e\u53f0\u67e5\u770b\u65e5\u5fd7\u3002&lt;\/h3&gt;&#8221;;<br \/>\necho &#8220;&lt;p&gt;\u5982\u679c\u5217\u8868\u5927\uff08&gt;500 \u884c\uff09\uff0c\u5efa\u8bae\u62c6\u5206\u5c0f\u6587\u4ef6\u53d1\u9001\u3002&lt;\/p&gt;&#8221;;<br \/>\n\/\/ \u8c03\u7528 send_excel.php\uff08\u901a\u8fc7 POST\uff09<br \/>\necho &#8220;&lt;form id=\\&#8221;f\\&#8221; method=\\&#8221;post\\&#8221; action=\\&#8221;send_excel.php\\&#8221;&gt;&#8221;;<br \/>\necho &#8220;&lt;input type=\\&#8221;hidden\\&#8221; name=\\&#8221;password\\&#8221; value=\\&#8221;&#8221; . htmlspecialchars($password) . &#8220;\\&#8221;&gt;&#8221;;<br \/>\necho &#8220;&lt;input type=\\&#8221;hidden\\&#8221; name=\\&#8221;filepath\\&#8221; value=\\&#8221;&#8221; . htmlspecialchars($target) . &#8220;\\&#8221;&gt;&#8221;;<br \/>\necho &#8220;&lt;input type=\\&#8221;hidden\\&#8221; name=\\&#8221;apiKey\\&#8221; value=\\&#8221;&#8221; . htmlspecialchars($apiKey) . &#8220;\\&#8221;&gt;&#8221;;<br \/>\necho &#8220;&lt;input type=\\&#8221;hidden\\&#8221; name=\\&#8221;fromEmail\\&#8221; value=\\&#8221;&#8221; . htmlspecialchars($fromEmail) . &#8220;\\&#8221;&gt;&#8221;;<br \/>\necho &#8220;&lt;button type=\\&#8221;submit\\&#8221;&gt;\u5f00\u59cb\u6279\u91cf\u53d1\u9001\uff08\u70b9\u51fb\u542f\u52a8\uff09&lt;\/button&gt;&lt;\/form&gt;&#8221;;<br \/>\necho &#8220;&lt;p&gt;&lt;a href=\\&#8221;{$_SERVER[&#8216;PHP_SELF&#8217;]}\\&#8221;&gt;\u8fd4\u56de&lt;\/a&gt;&lt;\/p&gt;&#8221;;<br \/>\nexit;<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/ \u524d\u7aef\u8868\u5355\uff08\u5355\u9875\u5305\u542b\u5355\u5c01 + \u6279\u91cf\u4e0a\u4f20\uff09<br \/>\n?&gt;<br \/>\n&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;meta charset=&#8221;utf-8&#8243;&gt;<br \/>\n&lt;title&gt;Resend \u90ae\u4ef6\u540e\u53f0\uff08\u7f51\u9875\u7248\uff09&lt;\/title&gt;<br \/>\n&lt;style&gt;<br \/>\nbody{font-family:Arial;max-width:900px;margin:20px auto;padding:10px}<br \/>\nlabel{display:block;margin-top:8px;font-weight:600}<br \/>\ninput,textarea{width:100%;padding:8px;margin-top:4px}<br \/>\n.half{width:48%;display:inline-block;vertical-align:top}<br \/>\n.btn{padding:10px 14px;background:#1677ff;color:#fff;border:0;border-radius:6px;cursor:pointer;margin-top:10px}<br \/>\n.note{color:#666;font-size:13px}<br \/>\n&lt;\/style&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;h1&gt;<\/p>\n<div style=\"position: relative; width: 100%; max-width: 800px; height: 300px; background-color: #eee; border-bottom: 2px solid #d33;\"><span class=\"wbspy-placeholder-tip\" style=\"position: absolute; top: 50%; left: 0; width: 100%; text-align: center; line-height: 20px; font-size: 16px; margin-top: -10px; color: #d33;\">\u91c7\u96c6\u5931\u8d25\uff0c\u8bf7\u624b\u52a8\u5904\u7406<\/span><\/div>\n<p><a rel=\"nofollow\" style=\"margin-top: 10px;\" href=\"http:\/\/loc-wp-cdnimg.jiyun.net\/blogtest\/2025\/08\/20250813001916311.jpg\" target=\"_blank\" rel=\"noopener\">http:\/\/loc-wp-cdnimg.jiyun.net\/blogtest\/2025\/08\/20250813001916311.jpg<\/a> Resend \u90ae\u4ef6\u540e\u53f0\uff08\u7f51\u9875\u7248\uff09&lt;\/h1&gt;<br \/>\n&lt;p class=&#8221;note&#8221;&gt;\u7b80\u5355\u6a21\u5f0f\uff1a\u8f93\u5165\u540e\u53f0\u5bc6\u7801\u540e\uff0c\u53ef\u5355\u5c01\u53d1\u9001\u6216\u4e0a\u4f20 Excel \u6279\u91cf\u53d1\u9001\uff08\u89c1\u4e0b\uff09\u3002&lt;\/p&gt;<\/p>\n<p>&lt;h2&gt;\u5355\u5c01\u53d1\u9001&lt;\/h2&gt;<br \/>\n&lt;form method=&#8221;post&#8221; enctype=&#8221;multipart\/form-data&#8221;&gt;<br \/>\n&lt;input type=&#8221;hidden&#8221; name=&#8221;action&#8221; value=&#8221;single&#8221;&gt;<br \/>\n&lt;label&gt;\u540e\u53f0\u5bc6\u7801&lt;\/label&gt;<br \/>\n&lt;input type=&#8221;password&#8221; name=&#8221;password&#8221; required&gt;<\/p>\n<p>&lt;label&gt;\u6536\u4ef6\u4eba\uff08\u591a\u4e2a\u7528\u9017\u53f7\u5206\u9694\uff09&lt;\/label&gt;<br \/>\n&lt;input type=&#8221;text&#8221; name=&#8221;to&#8221; placeholder=&#8221;recipient1@example.com,recipient2@example.com&#8221; required&gt;<\/p>\n<p>&lt;label&gt;\u4e3b\u9898&lt;\/label&gt;<br \/>\n&lt;input type=&#8221;text&#8221; name=&#8221;subject&#8221; required&gt;<\/p>\n<p>&lt;label&gt;HTML \u5185\u5bb9&lt;\/label&gt;<br \/>\n&lt;textarea name=&#8221;html&#8221; rows=&#8221;6&#8243;&gt;&lt;\/textarea&gt;<\/p>\n<p>&lt;label&gt;\u7eaf\u6587\u672c\u5185\u5bb9\uff08\u53ef\u9009\uff09&lt;\/label&gt;<br \/>\n&lt;textarea name=&#8221;text&#8221; rows=&#8221;3&#8243;&gt;&lt;\/textarea&gt;<\/p>\n<p>&lt;label&gt;\u9644\u4ef6\uff08\u53ef\u9009\uff0c\u591a\u6587\u4ef6\uff09&lt;\/label&gt;<br \/>\n&lt;input type=&#8221;file&#8221; name=&#8221;attachments[]&#8221; multiple&gt;<\/p>\n<p>&lt;button class=&#8221;btn&#8221; type=&#8221;submit&#8221;&gt;\u53d1\u9001\u5355\u5c01\u90ae\u4ef6&lt;\/button&gt;<br \/>\n&lt;\/form&gt;<\/p>\n<p>&lt;hr&gt;<br \/>\n&lt;h2&gt;Excel \u6279\u91cf\u53d1\u9001\uff08\u6309\u884c\u53d1\u9001\uff09&lt;\/h2&gt;<br \/>\n&lt;p class=&#8221;note&#8221;&gt;Excel \u5fc5\u987b\u5305\u542b\u5217\uff1a&lt;code&gt;email, subject, html_content, text_content&lt;\/code&gt;\u3002\u7b2c\u4e00\u884c\u4e3a\u8868\u5934\u3002&lt;\/p&gt;<br \/>\n&lt;form method=&#8221;post&#8221; enctype=&#8221;multipart\/form-data&#8221;&gt;<br \/>\n&lt;input type=&#8221;hidden&#8221; name=&#8221;action&#8221; value=&#8221;excel&#8221;&gt;<br \/>\n&lt;label&gt;\u540e\u53f0\u5bc6\u7801&lt;\/label&gt;<br \/>\n&lt;input type=&#8221;password&#8221; name=&#8221;password&#8221; required&gt;<\/p>\n<p>&lt;label&gt;\u4e0a\u4f20 Excel \u6587\u4ef6 (.xlsx \u6216 .xls)&lt;\/label&gt;<br \/>\n&lt;input type=&#8221;file&#8221; name=&#8221;excel_file&#8221; accept=&#8221;.xlsx,.xls&#8221; required&gt;<\/p>\n<p>&lt;button class=&#8221;btn&#8221; type=&#8221;submit&#8221;&gt;\u4e0a\u4f20\u5e76\u5f00\u59cb\u6279\u91cf\u53d1\u9001&lt;\/button&gt;<br \/>\n&lt;\/form&gt;<\/p>\n<p>&lt;hr&gt;<br \/>\n&lt;h3&gt;\u53d1\u9001\u65e5\u5fd7&lt;\/h3&gt;<br \/>\n&lt;p&gt;\u65e5\u5fd7\u6587\u4ef6\uff1a&lt;code&gt;&lt;?php echo htmlspecialchars($logFile); ?&gt;&lt;\/code&gt;&lt;\/p&gt;<br \/>\n&lt;p&gt;\u4f60\u53ef\u4ee5\u4e0b\u8f7d\u6216\u4f7f\u7528 FTP \u67e5\u770b\u6b64 CSV \u6587\u4ef6\u3002&lt;\/p&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>\/\/ File: send_excel.php<br \/>\n&lt;?php<br \/>\nrequire __DIR__ . &#8216;\/vendor\/autoload.php&#8217;;<br \/>\nuse PhpOffice\\PhpSpreadsheet\\IOFactory;<\/p>\n<p>\/\/ ========== \u914d\u7f6e\u533a ============<br \/>\n$expected_password = &#8216;changeme&#8217;; \/\/ \u4e0e index.php \u4e2d\u7684 $password \u4fdd\u6301\u4e00\u81f4<br \/>\n$uploadDir = __DIR__ . &#8216;\/uploads\/&#8217;;<br \/>\n$logFile = $uploadDir . &#8216;send_log.csv&#8217;;<br \/>\n\/\/ =================================<\/p>\n<p>if ($_SERVER[&#8216;REQUEST_METHOD&#8217;] !== &#8216;POST&#8217;) {<br \/>\ndie(&#8216;\u4ec5\u652f\u6301 POST&#8217;);<br \/>\n}<\/p>\n<p>$password = $_POST[&#8216;password&#8217;] ?? &#8221;;<br \/>\nif ($password !== $expected_password) die(&#8216;\u5bc6\u7801\u9519\u8bef&#8217;);<\/p>\n<p>$filepath = $_POST[&#8216;filepath&#8217;] ?? &#8221;;<br \/>\n$apiKey = $_POST[&#8216;apiKey&#8217;] ?? &#8221;;<br \/>\n$fromEmail = $_POST[&#8216;fromEmail&#8217;] ?? &#8221;;<\/p>\n<p>if (empty($filepath) || !file_exists($filepath)) die(&#8216;\u627e\u4e0d\u5230\u4e0a\u4f20\u7684 Excel \u6587\u4ef6&#8217;);<\/p>\n<p>\/\/ \u89e3\u6790 Excel<br \/>\n$spreadsheet = IOFactory::load($filepath);<br \/>\n$sheet = $spreadsheet-&gt;getActiveSheet();<br \/>\n$rows = $sheet-&gt;toArray();<\/p>\n<p>\/\/ \u5047\u8bbe\u7b2c\u4e00\u884c\u4e3a\u8868\u5934<br \/>\n$header = array_map(&#8216;strtolower&#8217;, $rows[0]);<br \/>\n$map = [];<br \/>\nforeach ($header as $i =&gt; $h) $map[$h] = $i;<\/p>\n<p>\/\/ \u5fc5\u987b\u5217<br \/>\nif (!isset($map[&#8217;email&#8217;])) die(&#8216;Excel \u7f3a\u5c11 email \u5217&#8217;);<\/p>\n<p>function send_via_resend_local($apiKey, $from, $toEmail, $subject, $html, $text, $attachments=[]) {<br \/>\n$data = [&#8216;from&#8217;=&gt;$from,&#8217;to&#8217;=&gt;[$toEmail],&#8217;subject&#8217;=&gt;$subject,&#8217;html&#8217;=&gt;$html,&#8217;text&#8217;=&gt;$text];<br \/>\nif (!empty($attachments)) $data[&#8216;attachments&#8217;] = $attachments;<br \/>\n$ch = curl_init();<br \/>\ncurl_setopt($ch, CURLOPT_URL, &#8216;https:\/\/api.resend.com\/emails&#8217;);<br \/>\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br \/>\ncurl_setopt($ch, CURLOPT_POST, true);<br \/>\ncurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE));<br \/>\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [<br \/>\n&#8216;Content-Type: application\/json&#8217;,<br \/>\n&#8216;Authorization: Bearer &#8216; . $apiKey<br \/>\n]);<br \/>\n$response = curl_exec($ch);<br \/>\n$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);<br \/>\nif (curl_errno($ch)) { $err = curl_error($ch); curl_close($ch); return [&#8216;ok&#8217;=&gt;false,&#8217;httpCode&#8217;=&gt;0,&#8217;response&#8217;=&gt;$err]; }<br \/>\ncurl_close($ch);<br \/>\nreturn [&#8216;ok&#8217;=&gt;($httpCode&gt;=200&amp;&amp;$httpCode&lt;300),&#8217;httpCode&#8217;=&gt;$httpCode,&#8217;response&#8217;=&gt;$response];<br \/>\n}<\/p>\n<p>\/\/ \u9010\u884c\u53d1\u9001\uff08\u4ece\u7b2c\u4e8c\u884c\u5f00\u59cb\uff09<br \/>\n$total = count($rows)-1;<br \/>\necho &#8220;&lt;h3&gt;\u5f00\u59cb\u53d1\u9001\uff0c\u5171\u8ba1: $total \u884c&lt;\/h3&gt;&#8221;;<br \/>\nflush();<br \/>\nfor ($r = 1; $r &lt; count($rows); $r++) {<br \/>\n$row = $rows[$r];<br \/>\n$email = trim($row[$map[&#8217;email&#8217;]] ?? &#8221;);<br \/>\nif (empty($email)) continue;<br \/>\n$subject = $row[$map[&#8216;subject&#8217;]] ?? &#8221;;<br \/>\n$html = $row[$map[&#8216;html_content&#8217;]] ?? ($row[$map[&#8216;html&#8217;]] ?? &#8221;);<br \/>\n$text = $row[$map[&#8216;text_content&#8217;]] ?? ($row[$map[&#8216;text&#8217;]] ?? &#8221;);<\/p>\n<p>\/\/ \u8fd9\u91cc\u6ca1\u6709\u9644\u4ef6\u5217\uff0c\u5982\u9700\u9644\u4ef6\u529f\u80fd\uff0c\u53ef\u5728\u8868\u683c\u4e2d\u6dfb\u52a0\u9644\u4ef6\u6587\u4ef6\u540d\u5217\uff0c\u5e76\u63d0\u524d\u4e0a\u4f20\u5230 uploads<br \/>\n$res = send_via_resend_local($apiKey, $fromEmail, $email, $subject, $html, $text);<br \/>\n$status = $res[&#8216;ok&#8217;] ? &#8216;success&#8217; : &#8216;failed&#8217;;<br \/>\n$line = [date(&#8216;Y-m-d H:i:s&#8217;), $email, $subject, $status, str_replace([&#8220;\\n&#8221;,&#8221;\\r&#8221;], [&#8216; &#8216;,&#8217; &#8216;], $res[&#8216;response&#8217;])];<br \/>\n$fp = fopen($logFile, &#8216;a&#8217;); fputcsv($fp, $line); fclose($fp);<\/p>\n<p>echo &#8220;&lt;p&gt;[$r] $email &#8211; $status (HTTP {$res[&#8216;httpCode&#8217;]})&lt;\/p&gt;\\n&#8221;;<br \/>\n\/\/ \u5c0f\u95f4\u9694\uff0c\u907f\u514d\u77ed\u65f6\u95f4\u5185\u7206\u53d1\u6d41\u91cf\uff08\u4f60\u53ef\u4ee5\u8c03\u6574\uff09<br \/>\nusleep(200000); \/\/ 0.2s<br \/>\nflush();<br \/>\n}<\/p>\n<p>echo &#8220;&lt;h3&gt;\u5168\u90e8\u53d1\u9001\u5b8c\u6210\uff0c\u65e5\u5fd7\u4fdd\u5b58\u5728: {$logFile}&lt;\/h3&gt;&#8221;;<\/p>\n<p>\/\/ File: .htaccess (\u53ef\u9009\uff0c\u5efa\u8bae\u653e\u5728 uploads \u76ee\u5f55\u91cc\u4ee5\u963b\u6b62\u76f4\u63a5\u8bbf\u95ee)<br \/>\n# Deny access to uploads<br \/>\nOrder Allow,Deny<br \/>\nDeny from all<\/p>\n<p>\/\/ End of package<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"flex justify-end\">\n<div class=\"touch:-me-2 touch:-ms-3.5 -ms-2.5 -me-1 flex flex-wrap items-center gap-y-4 p-1 select-none focus-within:transition-none hover:transition-none duration-300 group-hover\/turn-messages:delay-300 pointer-events-none opacity-0 motion-safe:transition-opacity group-hover\/turn-messages:pointer-events-auto group-hover\/turn-messages:opacity-100 group-focus-within\/turn-messages:pointer-events-auto group-focus-within\/turn-messages:opacity-100 has-data-[state=open]:pointer-events-auto has-data-[state=open]:opacity-100\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n<article class=\"text-token-text-primary w-full focus:outline-none scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]\" dir=\"auto\" tabindex=\"-1\" data-turn-id=\"8ce17316-33aa-4b05-9215-6ed414f1a513\" data-testid=\"conversation-turn-14\" data-scroll-anchor=\"true\" data-turn=\"assistant\"><\/article>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<div class=\"bg-token-bg-primary absolute start-0 z-20 h-full overflow-hidden transition-shadow\">\n<div class=\"dark:border-token-border-medium h-full overflow-hidden border-s border-gray-100\">\n<div class=\"h-full\">\n<section class=\"popover flex h-full w-full flex-col bg-transparent\">\n<section class=\"relative flex min-h-0 flex-auto grow flex-col\">\n<div class=\"react-scroll-to-bottom--css-iiaak-79elbk h-full\">\n<div class=\"react-scroll-to-bottom--css-iiaak-1n7m0yu flex flex-col\">\n<div class=\"block h-auto\">\n<div class=\"flex justify-start h-full\">\n<div class=\"relative z-0 flex h-full max-w-full\">\n<div id=\"codemirror\" class=\"_codemirror_176lt_1 z-10 flex h-full w-full flex-col items-stretch\">\n<div class=\"cm-editor \u037c1 \u037c2 \u037ct \u037cv \u037cw \u037cu\">\n<div class=\"cm-scroller\" tabindex=\"-1\">\n<div class=\"cm-gutters\" aria-hidden=\"true\">\n<div class=\"cm-gutter cm-lineNumbers\">\n<div class=\"cm-gutterElement\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/section>\n<\/section>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u63d0\u8bf4Cloudflare\u4f01\u4e1a\u90ae\u7bb1\u6bd4\u8f83\u597d\uff0c\u5c31\u8feb\u4e0d\u53ca\u5f85\u7684\u60f3\u642d\u5efa\u4e86\u00a0 \u00a0\u5b66\u4e60\u6559\u7a0b\uff1a\u767d\u5ad6cloudflare\u65e0\u9650\u591a\u4f01\u4e1a\u90ae\u7bb1\uff0c\u53ef\u6536\u53d1\u90ae\u4ef6\u00a0 \u89c1\u94fe\u63a5 \u63a5\u6536 \u9009\u4e86\u4e00\u4e2a\u597d\u7684\u57df\u540d hcwl.com\u4f5c\u4e3a\u6d4b\u8bd5 \u5f88\u5feb\u5728Cloudflare\u89e3\u6790\u597d\u4e86\uff0c \u53ef\u4ee5\u7ed9 *@h&#8230;<\/p>\n","protected":false},"author":1,"featured_media":652184,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[140],"tags":[153,22,477,41,37],"topic":[415],"class_list":["post-652181","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domain-website","tag-cloudflare","tag-mail","tag-477","tag-41","tag-sale","topic-code"],"_links":{"self":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/652181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=652181"}],"version-history":[{"count":8,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/652181\/revisions"}],"predecessor-version":[{"id":652196,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/posts\/652181\/revisions\/652196"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=\/wp\/v2\/media\/652184"}],"wp:attachment":[{"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=652181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=652181"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=652181"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/puo.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftopic&post=652181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}