PDA

View Full Version : Sending email using PHP


bruce
02-10-2004, 03:55 AM
Sending mail from PHP should be simple

<?php
$to = "someone@yourdomain.com";
$subject = "Test Mail from PHP";
$out = str_pad("This is a test", 20);
$header = "From: fromaddress@domain.com\nReturn-Path: fromaddress@domain.com\nX-Mailer: PHP/" . phpversion();

mail($to, $subject, $out, $header);

exit;

?>



[b]quote:Originally posted by dns78727

Has anyone tried using PHP's mail function to send email at discountasp? If so, were there any problems doing it? I'm going to be moving some code over from a different hosting service. It's all in PHP now. If it's not too difficult to get it running, I'd like to initially keep the PHP code and later convert it to .NET.

Also, can some one tell whether the correct file extension for PHP at is discountasp is .php or .php4?
</blockquote id="quote"></font id="quote">

dns78727
02-10-2004, 10:51 AM
Has anyone tried using PHP's mail function to send email at discountasp? If so, were there any problems doing it? I'm going to be moving some code over from a different hosting service. It's all in PHP now. If it's not too difficult to get it running, I'd like to initially keep the PHP code and later convert it to .NET.

Also, can some one tell whether the correct file extension for PHP at is discountasp is .php or .php4?

dns78727
02-13-2004, 06:24 AM
[b]quote:Originally posted by bruce

Sending mail from PHP should be simple

<?php
$to = "someone@yourdomain.com";
$subject = "Test Mail from PHP";
$out = str_pad("This is a test", 20);
$header = "From: fromaddress@domain.com\nReturn-Path: fromaddress@domain.com\nX-Mailer: PHP/" . phpversion();

mail($to, $subject, $out, $header);

exit;

?>
</blockquote id="quote"></font id="quote">

I know how to use the PHP mail function and already have PHP scripts that perform email hosted at another site that work fine there. What I'm interested in finding out is if anyone has run into any problems getting it to work specifically at discountasp. Sending mail from PHP is simple IF the hosting services has configured every thing properly.

bruce
02-13-2004, 07:16 AM
This is the test code we used to test our server.

It works.
[b]quote:Originally posted by dns78727

[b]quote:Originally posted by bruce

Sending mail from PHP should be simple

<?php
$to = "someone@yourdomain.com";
$subject = "Test Mail from PHP";
$out = str_pad("This is a test", 20);
$header = "From: fromaddress@domain.com\nReturn-Path: fromaddress@domain.com\nX-Mailer: PHP/" . phpversion();

mail($to, $subject, $out, $header);

exit;

?>
</blockquote id="quote"></font id="quote">

I know how to use the PHP mail function and already have PHP scripts that perform email hosted at another site that work fine there. What I'm interested in finding out is if anyone has run into any problems getting it to work specifically at discountasp. Sending mail from PHP is simple IF the hosting services has configured every thing properly.
</blockquote id="quote"></font id="quote">