473,224 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Sending a mail through exchange server

I want to send mail through PHP using the MS Exchange server.
My php.ini file looks like this (for the MAIL functions)
-------
[mail function]
; For Win32 only.
SMTP = exchgserver.test.com
smtp_port = 25

; For Win32 only.
sendmail_from = th********@test.com
-------
The following extensions have been loaded as well.
extension=php_imap.dll
extension=php_ldap.dll
After making these changes there were no errors/warnings. But I'm
unable to send any mails.
What are the other changes that i should do to send mails?

May 29 '07 #1
4 29036
Rajendran wrote:
I want to send mail through PHP using the MS Exchange server.
My php.ini file looks like this (for the MAIL functions)
-------
[mail function]
; For Win32 only.
SMTP = exchgserver.test.com
smtp_port = 25

; For Win32 only.
sendmail_from = th********@test.com
-------
The following extensions have been loaded as well.
extension=php_imap.dll
extension=php_ldap.dll
After making these changes there were no errors/warnings. But I'm
unable to send any mails.
What are the other changes that i should do to send mails?
try sending mail with a mail client like thunderbird
and see if that succeeds or fails
if that also fails it could give a clue about whats happening

greets
pacal
May 29 '07 #2
Rajendran wrote:
I want to send mail through PHP using the MS Exchange server.
My php.ini file looks like this (for the MAIL functions)
-------
[mail function]
; For Win32 only.
SMTP = exchgserver.test.com
smtp_port = 25

; For Win32 only.
sendmail_from = th********@test.com
-------
The following extensions have been loaded as well.
extension=php_imap.dll
extension=php_ldap.dll
After making these changes there were no errors/warnings. But I'm
unable to send any mails.
What are the other changes that i should do to send mails?
Do you actually have host exchgserver.test.com? What happens if you try
to ping it from your command line?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 29 '07 #3
On May 29, 11:51 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Rajendran wrote:
I want to send mail through PHP using the MS Exchange server.
My php.ini file looks like this (for the MAIL functions)
-------
[mail function]
; For Win32 only.
SMTP = exchgserver.test.com
smtp_port = 25
; For Win32 only.
sendmail_from = thegood...@test.com
-------
The following extensions have been loaded as well.
extension=php_imap.dll
extension=php_ldap.dll
After making these changes there were no errors/warnings. But I'm
unable to send any mails.
What are the other changes that i should do to send mails?

Do you actually have host exchgserver.test.com? What happens if you try
to ping it from your command line?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
When I try to ping that server it says "Request Time out"
I've configured my outlook with this server and I'm using it to send
and receive mails.

<?php
//change this to your email.
$to = "ra*@yahoo.com";
$from = "ra*@test.com";
$subject = "Hello! This is HTML email";
//begin message
$message = <<<EOF
<html>
<body bgcolor="#DCEEFC">
<center>
<b>Looool!!! I am reciving HTML email......</b<br>
<font color="red">Thanks!</font<br>
<a href="http://www.gmail.com/">Gmail</a>
</center>
<br><br>*** Now you Can send HTML Email through PHP<br>
Regards<br>Rajen
</body>
</html>
EOF;
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$to = "$to, $from"; // this will send to both emails at the same
time.
// now lets send the email.
$mail_sent = @mail($to, $subject, $message, $headers);
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
That is the php script which i copied from phpfreaks.com

May 30 '07 #4
Rajendran wrote:
On May 29, 11:51 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Rajendran wrote:
>>I want to send mail through PHP using the MS Exchange server.
My php.ini file looks like this (for the MAIL functions)
-------
[mail function]
; For Win32 only.
SMTP = exchgserver.test.com
smtp_port = 25
; For Win32 only.
sendmail_from = thegood...@test.com
-------
The following extensions have been loaded as well.
extension=php_imap.dll
extension=php_ldap.dll
After making these changes there were no errors/warnings. But I'm
unable to send any mails.
What are the other changes that i should do to send mails?
Do you actually have host exchgserver.test.com? What happens if you try
to ping it from your command line?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================

When I try to ping that server it says "Request Time out"
I've configured my outlook with this server and I'm using it to send
and receive mails.

<?php
//change this to your email.
$to = "ra*@yahoo.com";
$from = "ra*@test.com";
$subject = "Hello! This is HTML email";
//begin message
$message = <<<EOF
<html>
<body bgcolor="#DCEEFC">
<center>
<b>Looool!!! I am reciving HTML email......</b<br>
<font color="red">Thanks!</font<br>
<a href="http://www.gmail.com/">Gmail</a>
</center>
<br><br>*** Now you Can send HTML Email through PHP<br>
Regards<br>Rajen
</body>
</html>
EOF;
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$to = "$to, $from"; // this will send to both emails at the same
time.
// now lets send the email.
$mail_sent = @mail($to, $subject, $message, $headers);
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
That is the php script which i copied from phpfreaks.com
A lousy script - html email should always be sent multipart - with text
and html parts. But that's beside the point.

What errors do you get? "It doesn't work" isn't very descriptive.

The fact you can't ping the server may be telling - or it may not. It's
possible the server is not available from your webserver; but it's also
possible the sysadmin has disabled icmp echo requests (I normally do).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 31 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: martin smith | last post by:
Here's the scenario. I'm currently using cdosys/asp to send mail to our SMTP server. We use a product called MailFilter to check for SPAM. It doesn't work very well. If MailFilter isn't working...
2
by: Eric Timely | last post by:
After a trust with exchange server established the xp_SendMail gives the following error: xp_sendmail: failed with mail error 0x80070005 Prior to the trust everything worked fine. I have...
2
by: Brent | last post by:
Hi, I have a C# asp.net app that sent mail fine on server 2000 or win 2000, but now I moved it to our new 2003 box, and it's giving me "The 'SendUsing' configuration is invalid" This is the code...
0
by: darin | last post by:
I am trying to send email through our Exchange server but the emails are sitting the queue folder. In the Default SMTP Virtual Server properties of IIS I *think* I have to point to our Exchange...
2
by: Gaz | last post by:
Hi all I am currently trying to send and email via exchange except I'm having a nightmare getting it working, you'd think this would be pertty simple wouldn't you? I have added a reference to...
2
by: RedEye | last post by:
Hello, I am trying to create a class to send email via POP3 or Exchange. Everything works fine when sending via POP3 but fails when sending via exchange. Error: Could not access 'CDO.Message'...
8
by: Frank | last post by:
I think I've confused myself completely here :-) I have used System.Web.Mail, but am not sure if this works with Exchange Server 5.5. I asked the client if they're email server supported SMTP, and...
9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
8
by: Michel Posseth [MCP] | last post by:
Hi does someone has experience with this ?? i have made a lot of apps in the past that were capable of sending e-mails the server i then talked to was a Linux SMTP server and it worked great ...
2
abdoelmasry
by: abdoelmasry | last post by:
Hi men i have big problem with microsoft exchange server 2003 i installed exchange server as main mail server to use it on in company i have static real ip address im sending and...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.