Mailchimp API 403 Forbidden Error - mailchimp

I got various Websites that are accessing to Mailchimp API to subscribe addresses into Mailchimp Lists and getting Entries from there.
A few days ago, the API Calls are canceled due to a 403 Forbidden (Generic Error) when accessing a resource.
Error message:
Array
(
[headers] => Array
(
[url] => https://us8.api.mailchimp.com/3.0/lists/XXXXXXX/members?
[content_type] => text/html
[http_code] => 403
[header_size] => 170
[request_size] => 312
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0,292724
[namelookup_time] => 0,004255
[connect_time] => 0,018535
[pretransfer_time] => 0,161542
[size_upload] => 0
[size_download] => 162
[speed_download] => 553
[speed_upload] => 0
[download_content_length] => 162
[upload_content_length] => 0
[starttransfer_time] => 0,292685
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => 104.83.97.93
[certinfo] => Array
(
)
[primary_port] => 443
[local_ip] => 80.74.145.2
[local_port] => 36488
[request_header] => GET /3.0/lists/XXXXXXX/members? HTTP/1.0
User-Agent: DrewM/MailChimp-API/3.0 (github.com/drewm/mailchimp-api)
Host: us8.api.mailchimp.com
Accept-Encoding: deflate, gzip
Accept: application/vnd.api+json
Content-Type: application/vnd.api+json
Authorization: apikey XXXXXXXXXXXXXXXXXXXXXXXXXXX-us8
)
[httpHeaders] => Array
(
[Server] => openresty
[Content-Type] => text/html
[Content-Length] => 162
[Vary] => Accept-Encoding
[Date] => Tue, 05 Jun 2018 13:58:16 GMT
[Connection] => close
)
[body] => <html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
)
Is Mailchimp blacklisting IP adresses? Because, when a clone the website to another IP Host the authentication works correctly.
If yes, is it possible to resolve the blacklisting, or at least monitor that issue?

Related

'email has been sent' massage is shown email is not receiving in CodeIgniter

i have use CodeIgniter 2.2.6
i am trying to sent email but i can't get error and not received email
<?php
class email_otp_demo extends CI_Controller
{
public function index()
{
$this->load->library('email');
$config = Array(
'protocol' => 'smpt',
'mailpath' => '/usr/sbin/sendmail,
//'mailpath' => 'www.google.com', also try
'smtp_host' => 'smtp.gmail.com',
'smtp_port' => 587,
//'smtp_port' => 456, also try
'smtp_user' => 'my.email#gmail.com',
'smtp_pass' => 'mypassword',
'smtp_timeout'=>50,
'mailtype' => 'text',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE,
'newline' =>'\r\n'
);
// glnlwboynexfjqxj
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->set_crlf("\r\n");
$this->email->from('my.email#gmail.com', 'Social media website');
$this->email->to('sender#yahoo.com');
//$this->email->to('sender#gmail.com'); also try this
// $this->email->cc('another#another-example.com');
// $this->email->bcc('them#their-example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
echo $this->email->send();
echo "<hr>";
echo $this->email->print_debugger();
}
}
?>
i have get following output but not received email
1
Your message has been successfully sent using the following protocol: mail
User-Agent: CodeIgniter
Date: Sun, 4 Dec 2022 16:53:27 +0530
From: "Social media website" <renish.batada#gmail.com>
Return-Path: <renish.batada#gmail.com>
Reply-To: "renish.batada#gmail.com" <renish.batada#gmail.com>
X-Sender: renish.batada#gmail.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <638c832f6b8c0#gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
=?iso-8859-1?Q?Email_Test?=
Testing the email class.
i have also try to enable and disable to step verification
but not received email
i use app password and original password but not workworking

Zoom Api Access Token expire And Refresh Token generation not Working

I am trying to integrate Zoom with my CodeIgneter application using API with OAuth method. I created an Access Token and integrated my Zoom account with my application successfully.
After 1 hr the Zoom account access key expired.
In the Zoom API document it says that after 1 hr the access token will expire and after that we can generate an access token using Refresh Token.
Used Document: OAuth Document:-
I am creating a function to create an access token after expired by using the refresh token.
My Code is:
$clients = new GuzzleHttp\Client(['base_uri' => 'https://zoom.us']);
$arr_tokens = $this->get_access_token();
$refresh_tokens = $arr_tokens->refresh_token;
$response = $clients->request('POST', '/oauth/token', [
"headers" => [
"Authorization" => "Basic Q2xpZW50X0lEOkNsaWVudF9TZWNyZXQ=". base64_encode(CLIENT_ID.':'.CLIENT_SECRET)
],
'form_params' => [
"grant_type" => "refresh_token",
"refresh_token" => $refresh_tokens
],
]);
Here $refresh_tokens have my refresh token.CLIENT_ID and CLIENT_SECRET are my client id and client secret key.
I am trying this code and printed the response. But the response is not similar to what I expected. There is no access token or refresh token.
Expected response:
{
"access_token": "eyJhbGciOiJIUzUxMiIsInYiOiIyLjAiLCJraWQiOiI8S0lEPiJ9.eyJ2ZXIiOiI2IiwiY2xpZW50SWQiOiI8Q2xpZW50X0lEPiIsImNvZGUiOiI8Q29kZT4iLCJpc3MiOiJ1cm46em9vbTpjb25uZWN0OmNsaWVudGlkOjxDbGllbnRfSUQ-IiwiYXV0aGVudGljYXRpb25JZCI6IjxBdXRoZW50aWNhdGlvbl9JRD4iLCJ1c2VySWQiOiI8VXNlcl9JRD4iLCJncm91cE51bWJlciI6MCwiYXVkIjoiaHR0cHM6Ly9vYXV0aC56b29tLnVzIiwiYWNjb3VudElkIjoiPEFjY291bnRfSUQ-IiwibmJmIjoxNTgwMTQ3Mzk0LCJleHAiOjE1ODAxNTA5OTQsInRva2VuVHlwZSI6ImFjY2Vzc190b2tlbiIsImlhdCI6MTU4MDE0NzM5NCwianRpIjoiPEpUST4iLCJ0b2xlcmFuY2VJZCI6MjZ9.5c58p0PflZJdlz4Y7PgMIVCrQpHDnbM565iCKlrtajZ5HHmy00P5FCcoMwHb9LxjsUgbJ7653EfdeX5NEm6RoA",
"token_type": "bearer",
"refresh_token": "eyJhbGciOiJIUzUxMiIsInYiOiIyLjAiLCJraWQiOiI8S0lEPiJ9.eyJ2ZXIiOiI2IiwiY2xpZW50SWQiOiI8Q2xpZW50X0lEPiIsImNvZGUiOiI8Q29kZT4iLCJpc3MiOiJ1cm46em9vbTpjb25uZWN0OmNsaWVudGlkOjxDbGllbnRfSUQ-IiwiYXV0aGVudGljYXRpb25JZCI6IjxBdXRoZW50aWNhdGlvbl9JRD4iLCJ1c2VySWQiOiI8VXNlcl9JRD4iLCJncm91cE51bWJlciI6MCwiYXVkIjoiaHR0cHM6Ly9vYXV0aC56b29tLnVzIiwiYWNjb3VudElkIjoiPEFjY291bnRfSUQ-IiwibmJmIjoxNTgwMTQ3Mzk0LCJleHAiOjIwNTMxODczOTQsInRva2VuVHlwZSI6InJlZnJlc2hfdG9rZW4iLCJpYXQiOjE1ODAxNDczOTQsImp0aSI6IjxKVEk-IiwidG9sZXJhbmNlSWQiOjI2fQ.DwuqOzywRrQO2a6yp0K_6V-hR_i_mOB62flkr0_NfFdYsSqahIRRGk1GlUTQnFzHd896XDKf_FnSSvoJg_tzuQ",
"expires_in": 3599,
"scope": "user:read" }
Actual Response:
GuzzleHttp\Psr7\Response Object
[reasonPhrase:GuzzleHttp\Psr7\Response:private] => OK
[statusCode:GuzzleHttp\Psr7\Response:private] => 200
[headers:GuzzleHttp\Psr7\Response:private] => Array
(
[Date] => Array
(
[0] => Thu, 03 Sep 2020 12:58:09 GMT
)
[Content-Type] => Array
(
[0] => text/html;charset=utf-8
)
[Transfer-Encoding] => Array
(
[0] => chunked
)
[Connection] => Array
(
[0] => keep-alive
)
[Server] => Array
(
[0] => ZOOM
)
[x-zm-trackingid] => Array
(
[0] => WEB_af014e94c93acce064094d6fcc84cdcf
)
[X-Content-Type-Options] => Array
(
[0] => nosniff
)
[Content-Security-Policy] => Array
(
[0] => upgrade-insecure-requests; default-src https://*.zoom.us https://zoom.us https://d17o6on0vd932d.cloudfront.net blob: 'self'; script-src 'unsafe-eval' 'unsafe-inline' blob: about: https://ruanshi2.8686c.com https://ajax.aspnetcdn.com/ajax/3.5/MicrosoftAjax.js https://appsforoffice.microsoft.com https://assets.zendesk.com https://autocomplete.demandbase.com https://cdn.wootric.com https://cdncache-a.akamaihd.net https://connect.facebook.net https://consent.trustarc.com https://d.adroll.mgr.consensu.org https://d2b9h3rz4xo53c.cloudfront.net https://d24cgw3uvb9a9h.cloudfront.net https://googleads.g.doubleclick.net https://pi.pardot.com https://s.dcbap.com https://s.ytimg.com https://s3.amazonaws.com https://scout-cdn.salesloft.com https://sealserver.trustwave.com https://secure-cdn.mplxtms.com https://serve2.cheqzone.com https://snap.licdn.com https://sp.analytics.yahoo.com https://static.zdassets.com https://static2.sharepointonline.com https://tag.demandbase.com https://tpc.googlesyndication.com https://tracking.g2crowd.com https://trk.techtarget.com https://www.comeet.co https://www.dropbox.com https://www.google-analytics.com https://static.zoom.com.cn https://www.googleadservices.com/pagead/conversion_async.js https://www.googletagmanager.com/gtm.js https://optimize.google.com https://tagmanager.google.com https://www.gstatic.com/recaptcha/releases/ https://google.com https://docs.google.com https://cse.google.com https://maps.google.com https://www.google.com https://linkedin.com https://platform.linkedin.com https://px.ads.linkedin.com https://ads.linkedin.com https://www.youtube.com https://d17o6on0vd932d.cloudfront.net https://*.ada.support https://*.adroll.com https://*.hotjar.com https://*.zoom.us https://*.zoomcloudpbx.com https://*.zoomus.cn https://*.zopim.com https://adroll.com https://zoom.us https://apis.google.com https://gstatic.zoom.com.cn 'self'; img-src https: about: blob: data: 'self'; style-src https: safari-extension: chrome-extension: 'unsafe-inline' data: 'self'; font-src https: safari-extension: chrome-extension: blob: data: 'self'; connect-src * about: blob: data: 'self'; media-src * rtmp: blob: data: 'self'; frame-src https: ms-appx-web: zoommtg: zoomus: wvjbscheme: data: 'self'; object-src 'none'; base-uri 'none';
)
[X-FRAME-OPTIONS] => Array
(
[0] => SAMEORIGIN
)
[Set-Cookie] => Array
(
[0] => zm_aid=""; Domain=.zoom.us; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly
[1] => zm_haid=""; Domain=.zoom.us; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly
[2] => cred=21ABCC12B70F62365DDF0B554A35C671; Path=/; Secure; HttpOnly
[3] => _zm_page_auth=us02_c_uEv-kiHgQvKAAar4F_rPWQ; Domain=.zoom.us; Path=/; Secure; HttpOnly
[4] => _zm_ssid=us02_c_aKIgfweHQQG5EaT2cZpweg; Domain=.zoom.us; Path=/; Secure; HttpOnly
[5] => _zm_ctaid=f889E52dRvqoURUKV2vCUg.1599137889254.83389fb9b0d366fa454e83b4f1b894ec; Domain=.zoom.us; Expires=Thu, 03-Sep-2020 14:58:09 GMT; Path=/; Secure; HttpOnly
[6] => _zm_chtaid=493; Domain=.zoom.us; Expires=Thu, 03-Sep-2020 14:58:09 GMT; Path=/; Secure; HttpOnly
[7] => _zm_ctaid=bksezrrWSqOKKGvcxDRklA.1599137889254.5f69b5a447060faa456f1bb911caa7f1; Domain=.zoom.us; Expires=Thu, 03-Sep-2020 14:58:09 GMT; Path=/; Secure; HttpOnly
[8] => _zm_chtaid=651; Domain=.zoom.us; Expires=Thu, 03-Sep-2020 14:58:09 GMT; Path=/; Secure; HttpOnly
[9] => _zm_csp_script_nonce=RodE7nd0SZSuAxPkY_1tLw; Domain=.zoom.us; Path=/; Secure; HttpOnly
[10] => _zm_currency=USD; Domain=.zoom.us; Expires=Fri, 04-Sep-2020 12:58:09 GMT; Path=/; Secure
[11] => _zm_mtk_guid=3a7d99ffa1474d8e837f0d7a34d285de; Domain=.zoom.us; Expires=Sun, 01-Sep-2030 12:58:09 GMT; Path=/; Secure
)
[p3p] => Array
(
[0] => CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"
)
[Content-Language] => Array
(
[0] => en-US
)
[Strict-Transport-Security] => Array
(
[0] => max-age=31536000; includeSubDomains
)
[X-XSS-Protection] => Array
(
[0] => 1; mode=block
)
[Referrer-Policy] => Array
(
[0] => strict-origin-when-cross-origin
)
)
[headerNames:GuzzleHttp\Psr7\Response:private] => Array
(
[date] => Date
[content-type] => Content-Type
[transfer-encoding] => Transfer-Encoding
[connection] => Connection
[server] => Server
[x-zm-trackingid] => x-zm-trackingid
[x-content-type-options] => X-Content-Type-Options
[content-security-policy] => Content-Security-Policy
[x-frame-options] => X-FRAME-OPTIONS
[set-cookie] => Set-Cookie
[p3p] => p3p
[content-language] => Content-Language
[strict-transport-security] => Strict-Transport-Security
[x-xss-protection] => X-XSS-Protection
[referrer-policy] => Referrer-Policy
)
[protocol:GuzzleHttp\Psr7\Response:private] => 1.1
[stream:GuzzleHttp\Psr7\Response:private] => GuzzleHttp\Psr7\Stream Object
(
[stream:GuzzleHttp\Psr7\Stream:private] => Resource id #11
[size:GuzzleHttp\Psr7\Stream:private] =>
[seekable:GuzzleHttp\Psr7\Stream:private] => 1
[readable:GuzzleHttp\Psr7\Stream:private] => 1
[writable:GuzzleHttp\Psr7\Stream:private] => 1
[uri:GuzzleHttp\Psr7\Stream:private] => php://temp
[customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
(
)
)
How to fix this issue.........????
"headers" => [
"Authorization" => "Basic Q2xpZW50X0lEOkNsaWVudF9TZWNyZXQ=". base64_encode(CLIENT_ID.':'.CLIENT_SECRET)
]
-- You are providing this wrong, it should be like this "Basic Your base64encoded[clientid:clientsecret]", Q2xpZW50X0lEOkNsaWVudF9TZWNyZXQ= you don't need to pass this, It should be like this
"headers" => [
"Authorization" => "Basic ". base64_encode(CLIENT_ID.':'.CLIENT_SECRET)
]

Laravel 7. How to download a file from server (FTP)?

I created a disk in config/filesystems.php file
'ftp' => [
'driver' => 'ftp',
'host' => 'ftp.domain.org',
'username' => 'username',
'password' => 'password',
'passive' => true,
'timeout' => 30,
'root' => '/',
'url' => '/'
],
The connection is tested and works. On the server this file exists:
$file_path = "/folder/aaa.txt";
But I can't download it! In the controller I wrote:
$file = Storage::disk('ftp')->download($file_path);
return response()->download($file);
And this is the outcome:
Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
The file "HTTP/1.0 200 OK Cache-Control: no-cache, private
Content-Disposition: attachment; filename=aaa.txt Content-Length: 0
Content-Type: text/plain Date: Fri, 10 Jul 2020 19:20:51 GMT"
does not exist
Additional issue
Instead of downloading it, how do I display the same file in the browser? The following code does not work in this case:
return response()->file($file_path);
Both response()->download($file) and Storage::download($file) will create a download response so you only need one of the two. Since your file is in remote storage you can just keep:
return Storage::disk('ftp')->download($file_path);
You can also customise the filename and headers. You can also (probably) make the file show inline by doing:
return Storage::disk('ftp')->download($file_path, 'any.txt', [
'Content-Disposition' => 'inline'
]);

SES integration in Magento with code

Please help me to integrate ses in magento as i have tried below method for sending email.But not getting any of the email in my inbox or spam.sendEmail()is not sending email.I have tried both for localhost and on server neither of them sending an email.
$config = array('auth' => 'login',
'username' => '***************',
'port'=>587,
'SMTP'=>true,// SMTP
'SMTPAuth' => true, // SMTP authentication
'Mailer' => "smtp",
'enable_starttls_auto' => true,
'host'=>"email-smtp.us-west-2.amazonaws.com",
'password' => '**************************');
ini_set('SMTP', Mage::getStoreConfig('system/smtp/host'));
ini_set('smtp_port', Mage::getStoreConfig('system/smtp/port'));
$ses = new SimpleEmailService($config);
$m = new SimpleEmailServiceMessage();
$m->addTo('xyz.test#gmail.com');
$m->setFrom('xyz.test#gmail.com');
$m->setSubject('You have got Email!');
$m->setMessageFromString('Your message');
if($ses->sendEmail($m)){
echo "done";die;
}
One of the try given me this error:-
stdClass Object ( [error] => Array ( [curl] => 1 [code] => 60 [message] => SSL certificate problem: unable to get local issuer certificate [resource] => ) )

unable to Send email using codeigniter

I've a registration form and and want to send email to "To Email" and at the same time want to insert user record in db , insertion is successfull but email is not sending using codeigniter here is my code snippet from model and controller resp.
model:
public function add_user()
{
$data=array(
'username'=>$this->input->post('user_name'),
'first_name' => $this->input->post('fname'),
'last_name' => $this->input->post('lname'),
'email'=>$this->input->post('email_address'),
'password'=>md5($this->input->post('password'))
);
return $this->db->insert('user',$data);
//return $data;
}
and here is controller code:
$this->user_model->add_user();
$this->thank();
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'abc#gmail.com',
'smtp_pass' => '******',
'smtp_timeout' => '4',
'mailtype' => 'text',
'charset' => 'iso-8859-1'
);
$this->load->library('email',$config);
$this->email->from('mubbashir.azez#gmail.com');
$this->email->to($data['Email']);
$this->email->subject('test subject');
$this->email->message('hello CI');
$this->email->send();
echo $this->email->print_debugger();
here is view code:
<label for="email_address">Your Email:</label>
<?php echo form_error('email_address','<div class="error">', '</div>');?>
<input type="text" id="email_address" name="email_address" value="<?php echo set_value('email_address'); ?>" />
</p>
print debugger result:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: data
Filename: controllers/user.php
Line Number: 82
A PHP Error was encountered
Severity: Warning
Message: fgets() [function.fgets]: SSL: The operation completed successfully.
Filename: libraries/Email.php
Line Number: 1869
220 mx.google.com ESMTP ea4sm1055346wib.7 - gsmtp
hello: 250-mx.google.com at your service, [139.190.86.52]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN
250-ENHANCEDSTATUSCODES
250 CHUNKING
from: 250 2.1.0 OK ea4sm1055346wib.7 - gsmtp
to: 555 5.5.2 Syntax error. ea4sm1055346wib.7 - gsmtp
The following SMTP error was encountered: 555 5.5.2 Syntax error. ea4sm1055346wib.7 - gsmtp
data: 503 5.5.1 RCPT first. ea4sm1055346wib.7 - gsmtp
The following SMTP error was encountered: 503 5.5.1 RCPT first. ea4sm1055346wib.7 - gsmtp
The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
Date: Wed, 12 Feb 2014 03:26:52 +0500
From: <mubbashir.azez#gmail.com>
Return-Path: <mubbashir.azez#gmail.com>
Subject: =?utf-8?Q?test_subject?=
Reply-To: "mubbashir.azez#gmail.com" <mubbashir.azez#gmail.com>
X-Sender: mubbashir.azez#gmail.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <52faa3ac53dcf#gmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_52faa3ac53dd9"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_52faa3ac53dd9
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
hello CI
--B_ALT_52faa3ac53dd9
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
hello CI
--B_ALT_52faa3ac53dd9--
The return value in your model must be
$data
and in your controller code:
replace this
$this->user_model->add_user();
with
$data = $this->user_model->add_user();
You have to put this into your controller:
$data=array(
'username'=>$this->input->post('user_name'),
'first_name' => $this->input->post('fname'),
'last_name' => $this->input->post('lname'),
'email'=>$this->input->post('email_address'),
'password'=>md5($this->input->post('password'))
);
Pass this $data to your model:
$this->user_model->add_user($data);
In your model also write:
add_user($data);
Then change this line also
$this->email->to($data['Email']);
to
$this->email->to($data['email']);

Resources