Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail, SMTP, ini_set - Sendmail stopped working

Status
Not open for further replies.

CliveC

Programmer
Joined
Nov 21, 2001
Messages
1,222
Location
US
<?
$to =&quot;them@theirsite.com&quot;;
$subject=&quot;A Subject&quot;;
$msg =&quot;A Message&quot;;
$from =&quot;me@mysite.com&quot;;
ini_set (&quot;SMTP&quot;, &quot;mail.mysite.com&quot;);
mail(&quot;$to&quot;,&quot;$subject&quot;,&quot;$msg&quot;,&quot;From: $from&quot;);
?>

My ISP (uplinkearth) recently made some changes which required me to change PHP code to add the ini-set line shown above.

Prior to this change the code worked regardless of whether the &quot;to&quot; or &quot;from&quot; was from an email @mysite.com.

Since the change it works if the mail is &quot;to&quot; an address at @mysite.com but does not work if the &quot;from&quot; is an address at @mysite.com and the &quot;to&quot; is not.

sendmail_from is set to me@loacalhost.com in the php ini file.

Any ideas?

Clive
 
sleipnir214, thanks for your reply.

Yes I have but they no longer provide technical support for the plan which I am on even though PHP was supported on my plan level at the time I signed up.

Clive
 
At the time of the change they sent this notice:

> Sent: Tuesday, September 30, 2003 3:40 PM
> Subject: MAINTENANCE NOTICE - PLANNED PHP CHANGES
>
> MAINTENANCE NOTICE - PLANNED PHP CHANGES
>
> Maintenance Schedule planned for Friday October 3, 2003.
>
> Effective this date, all PHP mail scripts will be required to
> specify an address for the SMTP relay server. To do this add
> the following line to your script prior to calling the &quot;mail&quot;
> function:
>
> ini_set (&quot;SMTP&quot;, &quot;mail.your_domain_name&quot;);
>
> Replace the value &quot;your_domain_name&quot; with your actual domain
> name. Also note that standard mail rules apply; that is, the
> sender or recipient address must be an address at your domain
> or the message will not be sent.
>
> These updates may require you to review and update your scripts
> to be in compliance with the change.

Clive
 
You didn't answer the question. Is your ISP's PHP installation running on Win32? If not, that setting is ignored.

The PHP online manual states explicitly at [/i]SMTP: Used under Windows only: DNS name or IP address of the SMTP server PHP should use for mail sent with the mail() function.[/u]

To find out the OS on which you're running, run a script like:

<?php print PHP_OS; ?>

Which will tell you the OS. If it's a unix-like OS, your ISP has no idea what they're talking about.



Want the best answers? Ask the best questions: TANSTAAFL!!
 
Problem solved by adding this line:
ini_set (&quot;sendmail_from&quot;, &quot;my-email-id@mysite.com&quot;);

Thanks anyway.

Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top