14
votes

I have website hosted at OpenShift. I tried to send mail using mail function of php. It just returned true, but no mail is received to whom I had sent. Please tell me procedure for sending the mail.

I searched a lot but none of the options worked.

1

1 Answers

17
votes

After searching alot I came up with the following solution:

Step 1: Create account on mailgun and add your OpenShift application url.

Step 2: Download the PhpMailer library from here and add it to your php folder

Step 3: Go through this sample example

Step 4: Replace username and password with the credentials you got after adding domain to mailgun.

Step 5: Done!