Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removereceived #342

Closed
ghost opened this issue Dec 30, 2016 · 2 comments
Closed

removereceived #342

ghost opened this issue Dec 30, 2016 · 2 comments
Labels
type: question question directed at the library

Comments

@ghost
Copy link

ghost commented Dec 30, 2016

We can remove the received ip address with this code (X-SMTPAPI header)

$filters = [ 'removereceived' => [ 'settings' => [ 'enable' => 1 ], ], ]; $mailData->setFilters($filters); $mail_json = $mailData->jsonString(); $message_headers = $message->getHeaders(); $message_headers->addTextHeader($header, $mail_json);

any way to achieve it with helper classes?

@ghost ghost changed the title milli piyango wrong issue Dec 30, 2016
@ghost ghost changed the title wrong issue removereceived Dec 30, 2016
@ghost
Copy link
Author

ghost commented Dec 30, 2016

OK I found a topic about it but still can't add header with using helper classes:
https://community.sendgrid.com/sendgrid/topics/strip-originating-ip-in-smtp-header

Example code:
$mail = new SendGrid\Mail($from, $subject, $to, $content); $mail->personalization[0]->addHeader('X-SMTPAPI','{"filters":{"removereceived":{"settings":{"enable":1}}}}');

Getting:
{"errors":[{"field":null,"message":"resource not found"}

@thinkingserious thinkingserious added the type: question question directed at the library label Jan 26, 2017
@thinkingserious
Copy link
Contributor

Hi @mlhkr,

Could you provide the rest of the code so that I can try to reproduce.

Also, this example might be helpful: https://github.com/sendgrid/sendgrid-php/blob/master/examples/helpers/mail/example.php#L22

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

1 participant