Mailgun having trouble dealing with attachments PHP -


I am currently connecting with mailguns in the webhocks so that I sent it through any e-mail and it is somewhere else Can pass

I have been successful in dealing with APIs and body inputs, but I am currently having trouble catching any attachments in an email.

Melgun says that he is a multilayer file, but I have tried to capture it and write information in a file, but it comes back as a blank table ... < Pre> $ file = fopen (__dir.c '/ files) txt', 'w') or die ("can not open the file."); ob_start (); var_dump ($ _file); Fillit ($ file, ob_get_clean ()) or die ("can not be saved in file."); Fclose ($ file);

Within the information of the post, I get an attachment parameter, which contains things like URL, content-type, name etc. I have tried to go to the URL of each attachment, but I ask a login box for a username and password and say "the server says: MG API" I have no idea that I need to pass some , So I can get the attachment back to pass as a file.

If someone can help me, then I appreciate it.

Thank you.

Great question,

As you said inbound webhoc mail from your server Coming, you are being sent a URL from which the attachment can be fetched.

In my case, this is https://api.mailgun.net/v2/domains/ & lt; & Lt; & Lt; MYDOMAIN & gt; & Gt; & Gt; / Message / WyJjZTL ..... SJD / Attachment / 0

Now if I certify that URL with username (API) and password, I can get an attachment. Example:

https: // API: PASSWORD@api.mailgun.net/v2/domains/< & Lt; MYDOMAIN & gt; & Gt; & Gt; & Gt; / Message / WyJjZTL .. ... SJD / Attachment / 0

Password is simply the API key, which you can find in the control panel on the left. ()

Hope this works for you as well as works for me, best regards

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -