PHP / jquery mail in local network - php

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

Related

What is the proper setup/architecture of postfix, phpmail, and and open mail relay service?

Setup:
Ubuntu 16.x, Postfix, PHPMailer
SocketLabs (mail relay service) - to send out server emails
Union Solution Exchange Server - to send and receive formal email from outlook
Im trying to send out emails from my ubuntu linux server that contain simple form data (name, message, phone etc).
I have been trying in vain to send emails from my PHP to emails, they send, but they get blocked as spam/junk.
I've recently switched mail services (from zoho to a solution union exchange server) and I cannot get past barracuda (even modifying whitelists / spam settings etc) with my own mail, but I can see them as junk in my hotmail. (cannot not send from mailserver#potlickers.com to support#potlickers.com). They get immediately canned and not delivered.
Solutions Union said I was spoofing the emails and I cannot whitelist my own domain I'm using and sending from? Ok. They suggested buying another domain. I now own potlickers.net.
They also mentioned I should take that domain and use it to send my emails via open relay (again socketlabs).
So, if my webserver is setup on a fqdm such as potlickers.com, and i send the mail from that server, how do i setup the correct architecture to send mails from potlickers.net to the open relayserver so my emails are free and clear and not spoofed?
Can i configure postfix to send mail from potlickers.net even though its hosting on blah.potlickers.com?
I understand to also add dkim and PTR.
Help stackoverflow1 - your my only hope. TIA much much mucho thanks.
So I think I got it.
Reconfigured postfix as a satellite. Pointed to smtp of relay mail server. Removed all SMTP settings in PHPmailer that point to server, and credentials.
Fire away - works like a charm.
Satellite server has the new domain potlickers.net versus the webserver domain potlickers.com
Seems to work ok for now. Will update moving forward.

Sending mail from webserver to external mail server with local domain name

This is an issue I've encountered several time and haven't yet found a decent solution for:
Sending an e-mail from a webserver on e.g. "domain.com", to info#domain.com which is hosted on an external mail server e.g. Google Mail
In my case I always send from PHP over Apache and often on shared hosting, but I can imagine this is the same case on other frameworks.
These e-mails always seem to be delivered to the local mail server, even if I set the MX records on that server to point to the right external mail server.
A solution for this is to use an external SMTP server, but this isn't always easy when you're working with clients that either need to set-up a new e-mail account on their server and provide the SMTP details or sign-up for a third-party SMTP server.
What is the solution for this? Is there no way around SMTP?
Most emai/MTA server "autoconfigure" themselves. They guess list of local email domains (doimans with locally hosted mailboxes).
In sendmail case you can turn it off adding the following line in sendmail.mc:
define(`confDONT_PROBE_INTERFACES', `True')
Documentation : cf/README - confDONT_PROBE_INTERFACES
I have had the same issue many many times (in my case using PHP on a LAMP stack).
Try/check the following.
If you are using cPanel or similar, set the MX records to the external mailserver (Google apps etc).
Set up an SPF record to allow your hosting website to send email (this way no need to configure SMTP).
This may not be applicable but if you are using something like phpmailer. Set the property $mail->isMail(); so it tries to use your SPF allowed local mail() function to send the email. Sorry for going off into very specific advice, but might help in your particular situation.
Worth checking there are not similarly named local mailboxes on your hosting box.
Hope this helps!

Using PHP to send mails from my organisation's email id?

So, I developed this web application which needs me to send emails to everyone (details in a mysql database), providing a unique set of user credentials. I have a virtual server on the University network where I am hosting my PHP based application, so it obviously doesn't have its own mail server/SMTP settings.
So, if I were to send out mails from a university network, I guess I should request the network admin for the SMTP settings for the university mail network and then use PEAR for it right?
I need to confirm this because it's kind of a big deal to make a request like that, and I myself have never used PHP to send mails 'from' an external email id not linked to the server.
Are there any alternatives to this?
Yes you can use PEAR::mail to send mails via SMTP server. However, if SMTP is configured on localhost you can simply use mail() function to send mail. You can also connect to SMTP server via socket but then you need to handle whole protocol communication.

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

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?

Categories