๋๋ Mail API๋ฅผ ์ง์ ํธ์ถํ ์๋ ์์ต๋๋ค.
// Notice that $image_content_id is the optional Content-ID header value of the// attachment. Must be enclosed by angle brackets (<>)$image_content_id = '<image-content-id>';// Pull in the raw file data of the image file to attach it to the message.$image_data = file_get_contents('image.jpg');try { $message = new Message(); $message->setSender('from@example.com'); $message->addTo('to@example.com'); $message->setSubject('Example email'); $message->setTextBody('Hello, world!'); $message->addAttachment('image.jpg', $image_data, $image_content_id); $message->send(); echo 'Mail Sent';} catch (InvalidArgumentException $e) { echo 'There was an error';
[[["์ดํดํ๊ธฐ ์ฌ์","easyToUnderstand","thumb-up"],["๋ฌธ์ ๊ฐ ํด๊ฒฐ๋จ","solvedMyProblem","thumb-up"],["๊ธฐํ","otherUp","thumb-up"]],[["์ดํดํ๊ธฐ ์ด๋ ค์","hardToUnderstand","thumb-down"],["์๋ชป๋ ์ ๋ณด ๋๋ ์ํ ์ฝ๋","incorrectInformationOrSampleCode","thumb-down"],["ํ์ํ ์ ๋ณด/์ํ์ด ์์","missingTheInformationSamplesINeed","thumb-down"],["๋ฒ์ญ ๋ฌธ์ ","translationIssue","thumb-down"],["๊ธฐํ","otherDown","thumb-down"]],["์ต์ข ์ ๋ฐ์ดํธ: 2025-09-04(UTC)"],[[["\u003cp\u003eThis guide details how to utilize the Mail API for sending emails.\u003c/p\u003e\n"],["\u003cp\u003eThe API is compatible with first-generation runtimes and is usable when upgrading to corresponding second-generation runtimes.\u003c/p\u003e\n"],["\u003cp\u003eTo send emails you must register your sender emails as authorized senders.\u003c/p\u003e\n"]]],[],null,["# Sending mail with the Mail API\n\nGo Java PHP Python\n\nThis guide describes how to use the Mail API to send mail.\n\n\u003cbr /\u003e\n\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n|\n| /services/access). If you are updating to the App Engine runtime, refer to the [Upgrade to second-generation runtimes]() page to learn about your migration options for legacy bundled services.\n\nBefore you begin\n----------------\n\nRegister your sender emails as authorized senders. For more information, see\n[who can send email](/appengine/docs/standard/services/mail#who_can_send_mail).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]