How to add PHP file to Blazor? - php

I have seen it can be done with PeachPie, but it requires you to host a server and I do not want a server with my blazor app. So is there any way to do it without a server?
What I am trying to do is send email using a Contact form, but all c# methods I have seen requires a server, but I have seen PHP ways of sending emails that doesn't require a server.
Thank you in advance.

Related

What is required on web server to send email using PHP/HTML form using Nginx?

I currently have a static website that I am trying to send an email form from. I am using a simple HTML form with fields such as name, email, message, etc. The PHP form is also very straight forward. I don't think there are any problems with the code. In fact, the code is basically exactly like any online tutorial you'd find (http://www.freecontactform.com/email_form.php). I think the problem has to do with the config on the server. I have a Digital Ocean server with Nginx. At first, when I tried to submit the email form I was getting a 405 error. Now that I handle 405 errors in the config file, I am getting the PHP form as a download when I hit the submit button. What do I need to install on the server or include in the config file to make this PHP email form work?
Edit/Update: I have installed Postfix on my web server and am able to successfully send emails from command line using Postfix to different emails outside the server (for instance, I can send from my root user to my personal email addresses on Gmail, etc.). I now have another problem...
This still doesn't help me on the front-end. When I try to click the submit button on the web page form it is still just downloading the PHP file. I think I am missing something in the php.ini folder and maybe some other things as well. Even though I have mail set up on the server, the PHP action button has no idea that it's set up or something along those lines.
You need to install a Mail Transport Agent (MTA) like postfix or exim4. I think you can configure nginx to rely emails to another smtp server.
Another way, would be installing swiftmailer and connect it with an email sending service as sendgrid, mandrill, sparkpost, etc.
Edit:
I personally recomend a sending service as they have white-listed IP for their sending services plus you save memory in your VPS server (as an MTA daemon is not required to run there).
I'm using sparkpost for a few projects and is working perfectly. They have a pretty high limit for a free account.
With any service you choose, ensure to enable DKIM and SPF to avoid been detected as spam.

PHP / jquery mail in local network

Normally I post my questions with my code, but this time, I have a question for you guys that I don't know were to start.
On my company I have made a web application in the local network. So I have a PC acting like a server with apache and then all other machines can access the site via the hostname of the server machine.
We use Microsoft Lotus Notes and Outlook to manage the mails in the company.
Is it possible to send mails via PHP or jquery on a local network? Can I send the emails via the users mail client? On visual basic I used to do this, the mail client of the user would send the email without the user notice at all.
The localhost doesn't work as as a SMTP server, right?
Thank you for your answer.
EDIT
I found a solution:
hMailSever
You can use php to send mail from the user, but it wouldn't be via the user's mail client. Something like this
mail('recipient#otherDomain.com','subject','message','From: sender#yourDomain.com');

Ingoing / Outgoing Email downloading and processing, Server Side

Basically I've been asked if there is any way that I can capture & download all incoming and outgoing emails ( preferably in text format ) going through a mail server. This downloading method needs to be done using PHP or similar server side language.
If I can pass the above stage, then the final goal is easily reachable, which is to allow me process the emails via a script of some sort.
If there is any sort of mediating RPM I can install that would allow me to port emails to a directory somewhere, could also be of great help.
I am completely lost on where to start with this, so any sort of pointers or advice is greatly appreciated.
Thanks
Scott
More Info :
Server : CentOS
Mail Server : Pop3
"Downloading" email is the same is fetching email. Have a look at the PHP IMAP extension.
Plenty of examples there to get you going.

Separating email server and application server

I have been assigned a task to separate email server and application server. I have little knowledge of server. I am using PHP. Earlier I use to send using phpmailer class. Now I have been asked to implement using PEAR and separating email server and application server. I have been told that we need to provide only the IP of the email server from the application server while sending email from the application server.
Please suggest me I don't know how to proceed with it.
Thanks in advance

read email from outlook php from local pc

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

Categories