Solved

Trying to send email from my hosting server via my exchange server ...

Posted on 2012-03-15
5
406 Views
Last Modified: 2012-06-27
Hi Experts,

I have a joomla website running on a web hosting server out on the internet. Its a hosting companies c-panel access to the website.

Im trying to create a form where a user has to fill in some details and when they hit submit i want the website to send me and email (exchange based) and send an email to the user (using my exchange server email account).

Every time we try and connect to port 25 is says it cant but l'm receiving email with no problem.

Your help and advice would be greatly appreciated.

Trevor
0
Comment
Question by:trevsoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:sbickerstaff
ID: 37724062
In most cases, people just use the mail() feature built into the php engine:

//--=[ DEFAULT MAIL HEADERS AND ADDITIONAL HEADERS ]=--
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

// additional headers 
$headers .= "From: John Smith <john.smith@me.com>\r\n";

//--=[ --------- END OF HEADER SETTINGS ---------- ]=--

//obtain parameters sent from function call
$to  = "<enter email address>";
$subject = "New Comment received throught site";

// -=[ MESSAGE IN HTML FORMAT ]=-
$message = "";

//--=[ --- SEND MESSAGE --- ]=--
if (mail($to, $subject, $message, $headers)) {
  return "Your comment was successfully sent.<br /><br /><br />";
}
else {
  return "There was an error during the submission";
}

Open in new window



So you could sent the email address to you and then send another to your customer with the 'from' field in the above code set to match your exchange email address
0
 
LVL 1

Author Comment

by:trevsoft
ID: 37724080
hi,

yes but im find that, when i try to access my exchange server it denies access.

All i really want to do is send the user an email and cc me a copy of the email so i know someone has signed up.


Trevor
0
 
LVL 3

Expert Comment

by:sbickerstaff
ID: 37724087
You mean access Exchange using outlook or via the code?
0
 
LVL 1

Author Comment

by:trevsoft
ID: 37724106
via code.




Trev
0
 
LVL 3

Accepted Solution

by:
sbickerstaff earned 500 total points
ID: 37724118
But if you were to use the mail() function of php, there's no requirement to connect to exchange via code. And as for cc'ing youself, check on how to add cc.

Then you will receive the cc and any of their replies into your exchange account.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question