Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create a mailbox database 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 >> Data…
The viewer will learn how to dynamically set the form action using jQuery.

863 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

25 Experts available now in Live!

Get 1:1 Help Now