Effectively using Google App Engine to send lots of emails using PHP?

妖精的绣舞 提交于 2019-12-03 21:58:53

Your first question:

having the app called 'example.appspot.com', can this be a sub domain on his site (like mailapp.example.com)?

Yes, as the FAQ say:

Google App Engine can be used with Google Apps to provide a custom domain name for your internet-facing application, e.g., myapp.com.

By default, when you deploy your service on Google App Engine, your service will be accessible at [your-application-id].appspot.com. In order to provide a stronger brand experience for your application, you may also want that application to be available at [my-brand].com or www.[my-brand].com.

In order to set up these branded access locations for your service, you must prove that you own the domain name or purchase the domain name through Google. Google App Engine allows you to prove ownership of your domain and purchase new domain names using Google Apps.

Your second question:

the email address the app uses is an admin on the application (like admin@example.appspot.com)... that has to be that? It can't possibly be something like example@example.com?

Sure, you can use the Google userids you want as your admin users for your apps.

I understand that sending out so many emails means I'll have to enable the billing on the application. I understand there is still a quota on how many I can send.

Yep, per the docs, $0.0001 per recipient emailed. With 75,000 people on the mailing list, that's $7.50 per mail sent to all of them. Per these other docs, the free quota is 2,000 recipients emailed per day, the absolute maximum is 7.4 millions (there also limits to the rate, i.e., how many recipients are mailed per minute in free and max quotas).

I ideally want to replace the PHP code where it sends out email (using mail() etc) and make it send out with Google App Engine instead.

Sorry, can't help you there, I run App Engine with Python, not PHP. But I hear that, with Quercus, it is possible to run PHP on the JVM "side" of App Engine.

user2978467

You can use appengine for PHP to send mails to users this way:

<?php

    require_once 'google/appengine/api/mail/Message.php';
    use google\appengine\api\mail\Message;

    $mail_options = [
        "sender" => 'you@example.com',
        "to" => $_POST['email'],
        "subject" => "Type a subject here",
        "textBody" => "Type message here",
            ];

    try {
    $message = new Message($mail_options);
    $message->send();
    } catch (InvalidArgumentException $e) {
    echo $e;
    }

?>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!