Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
The viewer will learn how to count occurrences of each item in an array.

762 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now