It works fine using below plugins from xampp
php_imap.dll
But I want to implement the same inside Codeigniter project
I tried below code from here https://www.electrictoolbox.com/php-imap-loop-messages-specific-subject/
$unreadEmails = imap_search($connection,
'UNSEEN SUBJECT "Create Ticket" FROM "admin#xyz.com"');
But it throws error :
Message: Call to undefined method Imap::imap_search()
I would like to get all email by unseen, subject contains, on date and if any attachments. Also, mark the email as read after processing.
So how to get source code of the existing IMAP API source code from xampp OR Any sample example to where the code which have config file, IMAP file to place under Codeigniter page. Thanks in advance
Related
Hello Stackoverflowers!
I have been in a really big bind trying to solve this configuration/implementation of a webhook that utilizes both the Stripe PHP library and the Mailgun API. My intention is to send an email (with Mailgun) whenever one of my Stripe customers performs a certain action which has been recorded as an event in my Stripe endpoint. I have been trying to follow the guidelines of this documentation https://stripe.com/docs/recipes/sending-emails-for-failed-payments but unfortunately I think I am missing something in my understanding of how to make this work. I have a SiteGround hosted WordPress site which I am trying to host my webhook.php file and Stripe PHP library on. I uploaded the entire Stripe PHP library (in a folder named "stripe-php-master") to my "/wp-includes/" directory. In the webhook.php file I changed the boilerplate code in the documentation (https://stripe.com/docs/recipes/sending-emails-for-failed-payments) from
// If you're using Composer, use Composer's autoload
require_once('vendor/autoload.php');
to
$file = dirname(__FILE__) . '/init.php';
require_once($file);
because I am not sure how to utilize "Composer" in this scenario within the confines/context of of a SiteGround hosted WordPress site, so I figured this may be a suitable approach (according to https://packagist.org/packages/stripe/stripe-php) please correct me if I am wrong! When I try to visit the URL of my webhook.php file at https://mysitename.com/wp-includes/stripe-php-master/webhook.php I receive this error "Fatal error: Uncaught Error: Class 'Mailgun\Mailgun' not found in /home/mysitef3/public_html/wp-includes/stripe-php-master/webhook.php:16 Stack trace: #0 {main} thrown in /home/mysitef3/public_html/wp-includes/stripe-php-master/webhook.php on line 16". Could any of you please help me figure out what I am doing wrong here please and thank you!!!
I have a problem with Laravel 5.7.22, I tried to activate the verification with the email and I get the message that:
A fresh verification link has been sent to your email address.
how it's properly working at least the part that send the emails with the verification link but when I click the generated link I get the following page:
I have tried to erase the project and reinstall it, and I also tried to generate the signature key with this command:
php artisan key:generate
that I have found in this other question, but that didn't work, I don't know what could be causing this issue.
I also tried to debug the the function hasValidSignature in the file UrlGenerator from Laravel, just because I read that it could help, but it doesn't make sense, I haven't event altered the middleware or something I'm just with the laravel routes that it generates by default.
The generated link looks something like this.
https://www.example.com/email/verify/1?expires=1548527438&signature=daebab97afbb2da6a0f37615bc3db7e59db9c59e704d185addcf88adf46e8f6d
I also have configured my .env file properly and the files under the config folder just for security.
Please help me, I'm integrating QuickBook API into our script and I get the message below when i run file: http://domain.com/build_20130416/dev/dev_ids_invoices.php
Fatal error: Call to undefined method QuickBooks_IPP::application()
I'm using php script.
Please take the time to read the documentation and look at the example files in the docs/example_app_ipp_v3/ directory for the code you downloaded. Also, make sure you follow the quick-start guide. And next time, post your code.
If you look in the same dev/ directory for the code you're using, you'll see a file named:
DO_NOT_USE_THESE_FILES.txt
With the contents:
DO NOT USE THE EXAMPLES IN THIS FOLDER!
THESE ARE ALL DEVELOPMENT/TEST SCRIPTS, AND ARE NOT PRODUCTION READY!
You should not be using the example script you're trying to use just like the file says.
It's a development testing script, and not an example that you should be using.
Instead, you should look at the code in the docs directory, which has tons of working examples. Here's a link for you to the examples on GitHub:
https://github.com/consolibyte/quickbooks-php/tree/master/docs/example_app_ipp_v3
Specifically, here's some related to invoices:
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_add.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_query.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_w_lines_query.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_with_custom_fields_add.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoices_for_customer_query.php
Ok. I have used the apparently working code(the main top answer with 136 green ticks):
Send email using the GMail SMTP server from a PHP page
in my php mail script, replacing the gmail user and pass with my own... at first I got errors that PEAR, then PEAR5 could not be found... so I copied those 2 files(I downloaded from pear site) into the script's folder...
Still, script didn't work.
I added some echoes to see where it halts, and it halts at this line(I think):
$mail = $smtp->send($to, $headers, $body);
My apache/php error log says this:
PHP Fatal error: Call to undefined method PEAR_Error::send()`
I have googled this error and found over a dozen pages but havn't found an anwser... mostly they seem to say something about "installing pear libraries."
I have not tried installing/configuring pear on my local server.... because I do not think I can install new packages on my webhost, so I need a more portable solution:
What I mean by this is a working script, and any relative class files I can just copy all into one folder to get it working..... so I can just copy this folder to any apache/php server and it will automatically work(by refrencing the script in html form), without having to install/configure some third party package on the server.
I also tried phpmailer which gave similar problems and it seems to also require pear so I don't really see the point of experimenting with phpmailer further if I cannot get pear to even work.
PHP Fatal error: Call to undefined method PEAR_Error::send()
This means you didn't get a mail object but an error object, probably because logging in failed or so. Add the following to your code:
$mail = Mail::factory(..);
if (PEAR::isError($mail)) {
echo $mail->getMessage() . "\n" . $mail->getUserInfo() . "\n";
die();
}
$mail->send(...);
Btw, using $searchengine to look for that error message would have given you the same answer.
As #cweiske states, adding the code provided by him will give the detailed error. In my case it is Unable to find class for driver smtpPHP Fatal error: Call to undefined m
ethod PEAR_Error::send()
So basically it attempted to include "Mail/smtp.php" and checkd for the Mail_smtp class, but was unable to find it. So either Mail/smtp.php doesn't exist, or including it did not define the Mail_smtp class.
To resolve this all you need to do is to download Pear mail from here and copy the mail folder on to your domain. that's it. your code should work without any issues.
Thanks that helped lead me to this error:
Unable to find class for driver smtp
Which led me to this page:
http://goonanism.com/blog/2010/06/08/using-pear-to-send-email-via-smtp/
which told me I needed additional files. after I added the files it worked.
Issue solved. But I think the requirement of those files should be documented better for people who want portable solutions like myself :)
I am doing Push Notification Service for Apple iphone/ipad. i got the server side code from http://code.google.com/p/apns-php/. it is working well.. but i have to implement it in Yii framework.
i have googled it. and got this
https://github.com/shiki/yii-apns
Here i need to set server_certificates_bundle_sandbox.pem, and device token dynamically at run time.I am new to yii..please help me how to use this component..
i have extracted all the files in components folder,and tried the below code.
$obj=new SAPNS();
$obj->providerCertificateFilePath="provider certificate file path";
$obj->rootCertificationAuthorityFilePath="root certificate path";
$obj1=$obj->getPushProvider();
but while calling getPushProvider method,i got the following error.
include(ApnsPHP_Push.php): failed to open stream: No such file or directory
There is no such a file ApnsPHP_Push.php in ApnsPHP folder in my components folder.dont know in which part i did mistake..
the guys has already wrapped up everything in a component, so you just need to put all the things in components directory and call the desired functions.
if you look at SAPNS.php its got a public property
$providerCertificateFilePath
and that will be the file path to your PEM file and other
$rootCertificationAuthorityFilePath
for secure certificate (if any).
After giving these values you have to call getPushProvider method that will give you an object for ApnsPHP_Push from here you can call this class normally as you do without framework.