Separating email server and application server - php

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

Related

How to add PHP file to Blazor?

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.

Proper approach to test inbound emails on localhost

I am currently working on a legacy CakePHP application that needs to to able to receive and parse emails using Sendgrid Webhooks. My team does it's development locally on our laptops and utilizes web servers for testing.
This feature should be able to receive an email from from an email client (gmail, etc.), parse it out and create items in the database based off of the email's contents. I am wondering what the most strait forward approach would be to test something like this locally while in development or if I am better off developing this on one of our servers in AWS? I am currently looking at Ngrok following this tutorial, but it is a bit dated and I wonder if there is a better way to handle this.
Also looking at using Mail Mine Parser for PHP, on the application side. If you happen to know of something better I would certainly be interested to know about it.
Thanks in advance for any feedback on the subject!
Handled a similar task using sengrid inbound webhooks and ngrok. The latter allows you to expose a public url on your local laptop/machine where sendgrid can send incoming emails.
Please check:
https://sendgrid.com/docs/for-developers/parsing-email/setting-up-the-inbound-parse-webhook
https://ngrok.com
I would suggest you test your webhook using ngrok before you set-up your own inbound webhook server.

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');

Exchange rejecting php mail from same domain

I have an IIS server running PHP on an Apache Module. I am running a domain on it, and this domain has a seperate setup for email which uses an exchange server. When I try to send email from the website using php mail() the exchange server rejects it. I.e. the header from line is sender#this-domain.com and it is sending to receiver#this-domain.com, both are email addresses set up in the exchange, even though the sender has no direct relationship with exchange.
The emails are not getting through. We tried using a Yahoo adress in the from line but nothing. Has anyone ever come across a problem like this.
You have to either configure the exchange server to accept relay requests based on the origin ip or some transparent authorization mechanism (don't know much about IIS and Exchange and integrated windows authentication, but the good people over at http://serverfault.com do. ). Or use some mailing library that can handle smpt authentication like e.g. http://swiftmailer.org
I once ran into a problem like this which involved the Exchange server not wanting to accept anonymous connections or that it would only accept mail from certain SMTP servers. Have you checked the configuration on your Exchange server to eliminate those possibilities?

Which email service shall I use for testing sending emails?

I'm coding in PHP w/ CodeIgniter and I'd like to test some of the features in my app that send emails.
For some reason, I couldn't send emails through my email account in my local server (XAMPP), and I also don't want some SPAM filter to think I'm spamming while I'm testing.
So is there any email service that I can use for testing purposes? preferably one that doesn't enforce SSL, since I have problems getting that to work on my local server.
Appreciate your help.
As long as you're not sending out dozens or hundreds of test E-Mails, use whatever your everyday E-Mail provider is (e.g. GMail). Set the SMTP server of your mailing function to point to Google's. (I think SSL is optional with GMail, but I may be wrong.)
If your mailing library doesn't support using an external SMTP server, switch to a different one. But I think CodeIgniter has you covered there.
If you just want to test the application functionality, check out Papercut. This utility simulates the sending of email without having to set up a mail server, works great!
edit: had wrong link.
I like to set up a test SMTP service on my development machine and just send to that. There are several good options listed under this question.

Categories