473,770 Members | 1,954 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.tes t.com
smtp_port = 25

; For Win32 only.
sendmail_from = th********@test .com
-------
The following extensions have been loaded as well.
extension=php_i map.dll
extension=php_l dap.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 29110
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.tes t.com
smtp_port = 25

; For Win32 only.
sendmail_from = th********@test .com
-------
The following extensions have been loaded as well.
extension=php_i map.dll
extension=php_l dap.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.tes t.com
smtp_port = 25

; For Win32 only.
sendmail_from = th********@test .com
-------
The following extensions have been loaded as well.
extension=php_i map.dll
extension=php_l dap.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.tes t.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*******@attgl obal.net
=============== ===
May 29 '07 #3
On May 29, 11:51 pm, Jerry Stuckle <jstuck...@attg lobal.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.tes t.com
smtp_port = 25
; For Win32 only.
sendmail_from = thegood...@test .com
-------
The following extensions have been loaded as well.
extension=php_i map.dll
extension=php_l dap.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.tes t.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...@attgl obal.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.c om";
$subject = "Hello! This is HTML email";
//begin message
$message = <<<EOF
<html>
<body bgcolor="#DCEEF C">
<center>
<b>Looool!!! I am reciving HTML email......</b<br>
<font color="red">Tha nks!</font<br>
<a href="http://www.gmail.com/">Gmail</a>
</center>
<br><br>*** Now you Can send HTML Email through PHP<br>
Regards<br>Raje n
</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...@attg lobal.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.tes t.com
smtp_port = 25
; For Win32 only.
sendmail_fr om = 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.tes t.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...@attg lobal.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.c om";
$subject = "Hello! This is HTML email";
//begin message
$message = <<<EOF
<html>
<body bgcolor="#DCEEF C">
<center>
<b>Looool!!! I am reciving HTML email......</b<br>
<font color="red">Tha nks!</font<br>
<a href="http://www.gmail.com/">Gmail</a>
</center>
<br><br>*** Now you Can send HTML Email through PHP<br>
Regards<br>Raje n
</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*******@attgl obal.net
=============== ===
May 31 '07 #5

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

Similar topics

3
6271
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 cdosys also has problems and emails don't get sent. As these email are confirmations for customer's bookings this means lots of customers calling to see where their confirmation emails have gone. The root of the problem is MailFilter but that here...
2
3152
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 tried the following: 1)Checking SQL and SQLAgents accounts all match up with default mail profile.
2
4596
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 now... MailMessage mail = new MailMessage(); mail.From = from;
0
3258
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 server somewhere. Where do I put our Exchange server name? Here is my code if it's of any value: using System; using System.Web.Mail;
2
11070
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 cdoex.dll in my project and this is my code: ADODB.ConnectionClass conn = null;
2
3521
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' object. The following code works fine in a VB.Net test app but fails on the web. Does anyone have an idea why??
8
4382
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 got the following reply (exact quote): Exchange 5.5 uses IMS connector for communication between the internal and the external world. IMS is based on SMTP Protocol. For mail flow within the organization Exchange 5.5 uses Message Transfer...
9
3225
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 CDOmail. I don't want to use the Outlook reference because outlook prompts each time program access it and I have found a way to disable that. Can I use webmail with exchange? Thanks
8
2848
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 Now i work in a company with a MS exchange server and would like to send some e-mails however i can`t get it to work at all error is : ( translated form the dutch language )
2
5755
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 receiving mails good but
0
9453
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.