Google App Engine GAE Php发送附件

Hello I'm trying to add a few attachments to my app in Google app engine. I send the email and get the body as well as the subject but for some reason the attachments don't come through and googles method of explaining it doesn't really do it any justice.

here is my app.yaml file

application: 'phpmail' 
version: 1
runtime:php
api_version:1
threadsafe: true

handlers:
-url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico

-url: .*
script:main.php

and here is the main.php file

<html>
<head> 
other info I have
</head>
<body>
<?php
require_once 'google/appengine/api/mail/Message.php';

use google\appengine\api\mail\Message;

// ...

$message_body = "...";

$mail_options = [
"sender" => "sender@gmail.com",
"to" => "reciever@yahoo.com",
"cc" => "reciever@aol.com",
"subject" => "Your account has been activatedd",
"textBody" => "Guten tag, here is an email, with hopefully two attachments",
];
image= open('./file1.png', 'file2.jpg')
        message.attachments=[(file1.png, file2.jpg())]
        image.close()
try {
  $message = new Message($mail_options);
  $message->send();
} catch (InvalidArgumentException $e) {
echo $e;
  }
{
   echo "Your message has been sent";
  }
?>
</body>
</html>

I don't see how the code you added even executes. Anyway, here's a way to do it.

$subject = uniqid();
$content = "Hello, world!";

$message = new Message();
$from = createMailAddress();
$message->setSender($from);
$to = createMailAddress();
$message->addTo($to);
$message->setTextBody($content);
$message->setSubject($subject);
$message->addAttachment('data.txt', 'Here is some text as an attachment');
$message->send();