So I'm using the following software:
- Adobe Dreaweaver for my PHP document & my HTML-coded contact form,
- WAMP for my reote testing server,
- Azure to host my webiite via the WebApp feature,
- SendGrid (which Azure promotes) for erwermy mailing functions.
Code: Select all
<?php require('/.../sendgrid-php/sendgrid-php.php'); $name = $_POST["name"]; $surname = $_POST["surname"]; $email = $_POST["yourEmail"]; $message = $_POST["yourMessage"]; $from = new SendGrid\Email("Example User", "firstname.lastname@example.org"); $subject = "Sending with SendGrid is Fun"; $to = new SendGrid\Email("Example User", "email@example.com"); $content = new SendGrid\Content("text/plain", "and easy to do anywhere, even with PHP"); $mail = new SendGrid\Mail($from, $subject, $to, $content); $apiKey = getenv('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'); $sg = new \SendGrid($apiKey); $response = $sg->client->mail()->send()->post($mail); echo $response->statusCode(); print_r($response->headers()); echo $response->body(); ?>
Code: Select all
Started: 30/10/2017 08:55 handler_mail.php - Put operation successful Mailing\sendgrid-php - error occurred - An error occurred - cannot put sendgrid-php. Access is denied. File activity incomplete. 1 file(s) or folder(s) were not completed. Files updated: 1 Files with errors: 1 Mailing\sendgrid-php Finished: 30/10/2017 08:55
Any reason as to why this is happening, how can I grant access to this file via the "require" field in the PHP documentation. I have to admits this is starting to grind on my patience so anyone who can point me in the right direction would be a star.