0
votes

So I have a bit of a complicated question, and I'm not even sure if this is even possible, but please leave any suggestions.

I am looking for a way to send precomposed drafts made in GMail through PHP. This will be used for an (semi-)automated payment confirmation system. This is the outline of the system:

  1. Customer comes in with a request.
  2. Company writes e-mail in advance, which should be sent as soon as the customer pays. This e-mail contains some text and an attachment.
  3. Customer pays.
  4. Payment system sends a message to my server. My script extracts all the information needed.
  5. Script accesses GMail account and sends the existing draft (which can be distinguished by looking at the subject).

Basically what I need is a way to implement step 5.

Again, this is probably a long shot but any help is appreciated.

1
Assuming you are using imap, drafts should just be another folder you can locate a message in. You can then create a new message from the draft. I agree with @Fred though. This approach doesn't make much sense. - John Cartwright

1 Answers

0
votes

Do you know Gmail API? You can create drafts, send emails and attach documents from PHP.

https://developers.google.com/gmail/api/downloads