Solved

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

Posted on 2012-03-15
5
397 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This article explains how to install and use the NTBackup utility that comes with Windows Server.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

808 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