Can you open the outllok through php, without being a mailto?

Asked

Viewed 325 times

1

I have an order system that sends automatic email to representatives with attachment of a pdf file made in fpdf, but now the company has requested that instead of sending automatic would like to use outlook as an alternative send, as this would receive acknowledgement of receipt and confirmation and maintain a history in the outllok until the order is made, I am outlook because all users using the system have it installed on the machines. I know that in C# asp.net this is possible, but in PHP I found nothing related to the subject.

Or there is a php library that could use it in a similar way to Webmail that could be called every time we complete a request?

I am using this link to send it until it fills the email of the recipient and the subject, but does not attach the generated pdf automatically.

<a href="mailto:[email protected]?subject=Envio de pedido&body=Por favor atentar aos ítens">Enviar</a>

  • Setting up outlook as the default email client on the machine would solve the problem?

  • 1

    It is already the default client, the problem is in attaching the pdf dynamically, without downloading the file and attaching manually, on aspx i use a dll that integrates outlook to system and internal email sending with it, I know that in this way is not possible on php so I created a link to call the default program.

  • gostaria de usar o outlook como alternativa de envio, pois assim receberia aviso de recebimento -> the ideal is to find out how Outlook can do this, and replicate the functionality in emails generated through PHP.

2 answers

4


Answering the core of your question, unfortunately PHP will not be able to do what you want, because as it runs on the server, it will not be able to do this exchange between the server and the client machine as it is proposing.


Meanwhile...

I did a brief research on Webmail libraries in PHP and found something that might be interesting to your system, which can be integrated into it: https://afterlogic.org/webmail-lite

According to the documentation he is "free and open source". Perhaps with it it is possible to make an integration to your system, call it when finalized the order and already insert all the shipping information, including the attachment (maybe a good developer is needed to do this).

If you get a solution in PHP (like a Webmail), it would be interesting to leave a feedback so that we can know if it worked in order to help others with the same demand.

  • This Webmail lite seems to be the email interface itself, right? The front end for you as an end user use happy and content?

  • @Jeffersonquesado If you want to open a wine too, it’s okay. :)

2

Exists as using exec, but this requires that PHP is being used on the client side, what is not common.

According to the documentation of Outlook CLI:

outlook.exe /c ipm.note /m [email protected]

Other commands/parameters available.


So you could use:

exec('outlook.exe /c ipm.note /m [email protected]');

It may be necessary to specify the path, so:

exec('"C:\Program Files (x86)\Microsoft Office\root\Office16\outlook.exe" /c ipm.note /m [email protected]');

Just be careful with the inserted email, because it can be malicious text, in which it would be possible to execute a code defined by the attacker, after all you are inserting it in a exec. If the email is [email protected] & notepad.exe would open the notepad.exe, for example.


Again, the client needs to be running PHP, which is certainly not applicable in most cases!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.