When sending a email via php i want it to appear in my outlooks sent items.
I have tried imap_send but it does not reflect in the sent items. Is this possible. Thanks
edit
i used imap_append to solve achieve this.
imap_append($connection, "{mail.example.com/novalidate-cert}INBOX.Sent")
The only way that I know for 100% sure this is possible is by sending through an Exchange account. That way, Exchange will sync the sent items folder on an Outlook client.
If your PHP instance is on the same machine as the Outlook instance, this may be what you're looking for - although I haven't tried it so I don't know if it works.
If your PHP instance is not on the same machine as Outlook and you don't use Exchange, you're scuppered.
EDIT
It may be possible to do this with IMAP, as long as you configure Outlook correctly, but it would also depend on the mail server keeping a local sent items folder and handling mail sent through it correctly, which it may not.
Related
I´m using Drupal (PHP) and sometimes I use it to send email to some of my registered users (ie. using a contact form located inside their profile). This is very common in every CMS, PHP forum, etc.
The thing is that Drupal usually prints out a successful message when the email was sent, and not always the email is actually sent.
On the other hand, my hosting uses VHM panel with VPS servers.
From their control panel I can check all mail that goes from my server to the outside. In VHM it´s called "Mail Delivery Reports". That´s accurate enough, and I think most VPS control panel probably have some similar utility.
My question is: When Drupal tells me that the email has been sent, and I go to the Mail Delivery report on my hosting control panel, and it says that it has not been sent. Is that a PHP flaw?
Is there a way to get accurate reports within PHP?
Please excuse my grammar. It has been kinda difficult for me to actually get myself clear on what I mean in english.
UPDATE:
I´m not asking if the user reads the email, not even if it later on gets bounced, just to know if PHP has some accurate way to report if the email was sent.
I know there are some services offering that, but I´m just asking about PHP capabilities (and if that´s actually possible).
PHP responsibility is to give it to your specified transport method. (sendmail, smtp etc.) and tell you if the transport accepted it or not.
If you use sendmail (or postfix) what php tells you is that it has been queued for sending and nothing else. PHP doesn't know if it will be sent or not. unless you parse the queues and try to go from there.
No. It is impossible for PHP to track sent emails. That is not, never has been, and never will be, PHP's job.
PHP simply generates the email (e.g. builds the html) and then hands it over to a mail transfer agent. e.g. your local sendmail.
In a real-world equivalent, PHP is you walking an envelope down to the street corner and dropping it into the mailbox. If the letter disappears down the chute, PHP will report success. After that, actual DELIVERY of the mail is entirely out of PHP's hands.
Maybe the mailbox gets flattened by a drunk driver, maybe the pickup truck gets into a firey crash, maybe the postal sorting facility gets hit by a meteor, etc...
None of that is PHP's problem, and undetectable by PHP anyways. It walked down the street, it saw the letter disappear down the slots. Mission accomplished.
At best you could set the "return service requested" mail headers, which 99.99% of people will probably ignore or disallow, or embed a web-bug inside the email and hope that the recipient's mail client will actually load the bug.
I have a script set up that will email a user an activation link when they insert their email into the provided input.
I'm using CodeIgniter's email class to send the multipart emails and the problem I'm having is that when the email is sent, the debugger says that the email was sent sucessfully but the message is never received.
When I send the email to my internal work email, it sends just fine. But when I send it to my gmail account, it never comes through.
I've managed to track down the issue as being a problem with inserting links within the email. When I remove the link, the email sends fine. I put the link back in and the email is never received by my gmail account.
Has anyone ever come accross this problem or do you have any insight into how to fix this?
your email is being rejected.. this is no CI issue..
Ok, so it sounds like the problem isn't with CodeIgniter or your code, but with the server's mail transfer agent sending it on to the Gmail server.
What happens is CodeIgniter puts together an email and gives it to the PHP engine, which passes it on to the mail transfer agent on the server for sending. The MTA will report back to PHP, and therefore CodeIgniter, that it has received the email properly. As PHP & CodeIgniter's jobs are finished at this point, they will report that they've sent successfully.
Check your spam folder in your Gmail to see if it's been put in there..? I haven't used CI for a while so can't remember exactly, but I think there's an HTML-email parameter you may need to set before you send. If so, Gmail might be expecting this to be set too.
Scroll down to 'Email Preferences' here:
http://codeigniter.com/user_guide/libraries/email.html and set the mailtype to HTML.
If that doesn't work, you will need to debug fully.
To debug the problem properly you will need to be able to access the MTA logs. Is this a local development server or a live production machine? Is it Linux or Windows? If Linux, which distribution? Do you know which MTA you are using? Do you have SSH access to the server?
If you can get SSH access and find out which MTA you have things will be a lot simpler to find out and you'll be able to monitor the outgoing messages and the destination servers' responses as they happen.
I have a strange requirement.
I need to read the outlook emails from a local pc using php .
I will get user credentials.
so is there any way to do this ?
it need to work well in all major browsers.
Thanks.
Not sure why you would want to try to get this from a LOCAL mail file on a 'single' pc, I would rather attack this from a POP3/IMAP route, it would THEN be a PHP based mail client, or whatever you need it for (fetching mail, filtering, checking, triggering an event, etc;).
But what you describe is just not feasible for anything, I can't see a client paying to have simple client mail accessed via PHP.
Here are some PHP / Email reading references:
http://garrettstjohn.com/entry/reading-emails-with-php/
http://davidwalsh.name/gmail-php-imap
http://www.tuxradar.com/practicalphp/15/6/3
As i'm knowing just about PHP and don't know at all about Mail Servers, what i want to know here is:
How can i get the "Replied" emails (from the receivers) for the mails i've send (by using PHP, with a address like xxxxxxx#gmail.com)
Does it need to setup my own Mail Server?
Unless using own Mail Server, is there any other easy way?
Honestly i'm not well understanding over IMAP or Email Protocols. Doing setup my own IMAP Server is far worse. Can it be done simply with a Web Hosting which supporting IMAP protocol? Or do i need to setup manually out from the start?
To be brief, i need a simple guide.
You only need a mail server if you don't already have a place where those reply-tos end up. Which adress are you sending them as? Where would you fetch the emails for those adress? You can ask PHP to log into any mail server that you'd fetch your emails from manually as well, so there shouldn't be a problem. But maybe I'm not getting you right.
Simply put the reply address to an email you own. For the example you gave to work, you would need to have the xxxx#gmail.com account.
Most people use something along the lines of mailer#youdomain.com, ans then create an account for that on their ma8lserver.
If you want to use your own domain, you don't need to run your own mailserver. Gmail, hotmail, and others have services that let you use their mailservers for your fomain, for free.
Lets take a look at the following scenario:
I have a websitesite, site.com. One customer support tech guy has an email account on it: techguy#site.com. Customers send messages to that email, tech guy replies via that email. They are both using desktop email clients (thunderbird, outlook...).
What I know is: using php to read incoming mail from customers
What I want to know is: how to use php to read outgoing mail that the tech guy is sending from his client via smtp, imap..
This would be used for archiving conversations between techs and customers without forcing them to use some php app on the site to send emails (I want them to use desktop clients).
I dont know much about email protocols, but I have plenty of experience in php. Im guessing that the email daemon could be setup to call a php script every time it recieves an outgoing email or something like that. Is there any way that this can be done?
The way how some products on the market are doing it is by requiring the user to install a plugin on his/her email client. Using this method doesn't matter what smtp server is used, the mails will be logged using the plugin.
Another way(this is just an idea) is to "force" the tech guy to use your smtp server so you can access the logs and see who sent mails and who is the receiver(accessing the logs using php)
It would be much easier to have a separate email address for logging purposes and simply keep it in the cc or bcc field for all communication between customer support and clients.
since you can have php interpret the emails, the best thing to do is have a dedicated email address that gets piped to a script (i know this is easy to set up cpanel)
you have the client email support#domain.com which gets piped to the script - do what you want with it there.
then you have the script email back out to bob#domain.com with a from address as support-reply#domain.com - which is also piped to a script
when he replies to that, it goes to support-reply#domain.com which goes to a script, which in turn you would process, then forward back out to the client#google.com with a return address of support#domain.com
i think amazon uses a similar technique so that people can email each other back and forth, but they create coded email addresses and have a database to keep track of who they are going to and coming from.