External SMTP setup on Azure - php

I have a website on Azure Web Apps and want to enable SMTP settings to be able to receive emails through my websites contact form. One of the solutions that I found on this forum were to use an external SMTP. I went over to my web root and modified the php.ini file, changing the default SMTP settings to the external SMTP I want to use. I changed the SMTP server name and the port number.
However, that does not suffice. I need to provide credentials for SMTP relay, and I don't understand how SMTP authentication comes into play here. I am currently using the mail function in my HTML form with PHP handling.
If someone could please guide me on the process, I'd be highly grateful.

Actually, on Azure, you don't need to use External SMTP server to send emails in your app. You can easily use SendGrid to satisfy this.
Here is a detailed guide on how to use the SendGrid email service from PHP: https://azure.microsoft.com/en-us/documentation/articles/store-sendgrid-php-how-to-send-email/.

Related

Email issue when using SMTP PHPMailer

I am working on an email functionality in PHP, SMTP with PHPMailer. In my office we have different servers. Here, it's working fine. But, when I am trying to send mails from outside the office, it doesn't work. I am using SMTP Auth False. I'm providing Hostname and Port number only.
Why isn't it working?
If you are not authenticating against the SMTP server probably is because your SMTP works only for your local office network.
For security reasons, your SMTP server may be requesting authentication or just not responding to connections outside your local network.
You need to ask IT guys on your office so they provide you some SMTP credentials to use outside the office.

How to set SMTP details in script?

As e-mails sent from my website usually go into Junk, I wanted to edit php.ini file to fix it, but it is not allowed by my hosting provider. They offered their own solution for this:
The solution we can offer you is to use SMTP for your mailservice.
You can do that by setting any script you are using to SMTP service
with the below details:
Incoming mailserver: mail.website.com
Outgoing mailserver: mail.website.com
Username: email account set with your domain
Password: your email account password.
I do have couple of .php scripts that send e-mails, but I don't know how to edit SMTP details in them. So how would I do that?
Thank You ))
You should try to use PHPMailer for sending the mails. You will get it here at:
http://phpmailer.worxware.com/
Advanced setup configuration for SMTP can be configured from the script itself if you are using PHPMailer. Detailed guide can be found here:
http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/

sending an email using MAMP and php scripts

Hi I am running MAMP on my mac to locally host a website. I want to send an email using php scripts. The stuff i looked online tells me about php scripts for emails but i am unable to send emails. I am guessing this has to do with MAMP settings or maybe i have to make changes to php.ini file but i cant find information regarding that. Can i send emails to my clients using my gmail address running php scripts. I am creating a signup page where once you signup successfully, the site sents you a welcome email. Can some body please guide me how to do this. I have used code from here:
http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
but this doesnt work.
i have used following settings:
$host = "ssl://smtp.gmail.com";
$port = "465";
MAMP is just Apache, MySQL and PHP and doesn't include a mail server. You could use postfix or, as you said, an external SMTP server.
If using Gmail make sure your account is setup to allow SMTP connections (it's off by default). This can be found somewhere in Settings in the web client. I'd recommend you test it with Mail or another mail client on your local machine to make sure Gmail is working as expected.
Finally (once the above is set up) SwiftMailer or PHPMailer are good mail libraries which can connect to remote SMTP servers. It'll save you a lot of headaches writing your own code, especially when it comes to file attachments and such.

Is there a way to add "send mail" functinality to Drupal on a site without SMTP server?

I have a (testing) Drupal 6 site on a free web hosting platform, which unfortunately removed SMTP support for free hostings.
Does any one know whether there's a way to give Drupal the ability to send emails on a site without SMTP server, e.g. via the public Gmail's SMTP server? can "sendmail" help in this case?
sendmail probably won't help: If the provider is blocking sending mails on the system, there will be no sendmail.
There is a Drupal mail module that allows direct communication with a SMTP server; it is based on the PHPMailer library. As far as I can see though, the Drupal 6 version is still in Beta
Libraries like SwiftMailer can talk to SMTP servers directly; here is an example on how to send an E-Mail via GMail

Mail() won't send in windows server2003

I installed PHP in windows server 2003. All the files are working fine except the mail issue. There is no problem in SMTP. Because I run the JSP project in the same server.In that mail function working fine. So where is the problem? And how can i manage? I set the SMTP server in PHP as
; For Win32 only.
SMTP = localhost
smtp_port = 25
Does the SMTP service need authentication? Maybe there is a setting in the JSP code which authenticates against the SMTP server? You could look at the JSP code to see if there is a different SMTP configuration.
Another reason could be that the SMTP allows only specific sender addresses/domains. Are the sender addresses of the PHP and JSP applications different?
If your smtp server is not exposed and protected behind a firewall you can allow relay and that should take care of it.
If not then verify you can send the email you want using telnet

Categories