473,320 Members | 2,027 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,320 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 29046
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.