Jump to content

mailing with php not working


sweinkauf13

Recommended Posts

Ok, so i keep hearing how "mailto" is horrible and that i should use php. Well PHP is not working. I am new to php and so i'm configuring my php.ini for sending mail. I'm stuck here (inside ny php.ini)

[mail function]; For Win32 only.SMTP = mail.yahoo.comsmtp_port = 25; For Win32 only.;sendmail_from = scpad@att.net

Now i am using a book to help me learn how to do this but it does not cover smtp_port = 25. So i was wondering if anyone knew the port i should be using for yahoo. If you could help me, i would appreciate it. If you need more from me, please ask. Oh ya, and if no one knows, if you could let me know what you use for these settings, i'll be willing to change my e-mail. But if possible, i dont want to do that.Thank you,youngwebmaster

Link to comment
Share on other sites

Most servers that have PHP installed also have a mail server installed, so on most live servers PHP uses localhost to send mail. If you want to use Yahoo, you need to first figure out if Yahoo allows their outgoing mail server to be used as a relay like that, most mail servers disable relaying because spammers can just connect to Yahoo's server and start sending mail. Port 25 is the default SMTP port though. FWIW, I don't have a mail server set up on my development PHP server, if I want to test mail functionality I upload my code to a live server.

Link to comment
Share on other sites

Ok, that's what i thought. Currently i can not upload files to a live server. So i wanted to be able to test my php scripts (including email scripts) through my development server. Is it possible?

Link to comment
Share on other sites

You can either find an open relay that you're allowed to use, or install your own mail server (which your ISP would probably block anyway, again for spam reasons). http://www.google.com/search?client=opera&...-8&oe=utf-8Your ISP might have a mail server you can use. For example, when I was on the home service with Cox, I think I needed to use smtp.west.cox.net to send email, I couldn't use anything else on their network. So your ISP might have a mail server available for you.

Link to comment
Share on other sites

I am wondering about Argosoft mail server. If anyone knows anything about this, please let me know. Also if you know the answers to the questions above, please let me know.thanks,youngwebmaster

Link to comment
Share on other sites

Justsomeguy:

The first step usually involves contacting them and asking.
Thank you. My isp has a table for connection to there outgoing and incoming mail servers. Thanks againOh and as for the Argosoft mail server, i do not need any information. Thanks and i'll let you guys know if i have any more problems with the server connection.
Link to comment
Share on other sites

I have a quick question about PHP mailing while this topic is here. Can I send confirmation emails to my sites users by using my Yahoo email account and PHP, or do I need to setup the emailing sever stuff like your talking about up there?

Link to comment
Share on other sites

I'm not sure. I know i've seen confermation in a cgi script before but i'm pretty new to php. Does anyone else know?

Link to comment
Share on other sites

Ok, so now i have apache set up where it can connect to an outgoing mail server. But i tested my script and it had problems. I'm new to php and this script is not very complicatied but i still dont know what to do. If anybody can help me fix my code i would appreciate it. Here's my php code:

<?if (($_POST[sender_name] == "") ||	($_POST[sender_email] == "") ||	($_POST[message] == "")  {	header ("Location: simple_form.html");	exit;}$msg = "E-mail sent from scpadonline.com\n";$msg .= "Sender's Name:\t$_POST[sender_name]\n";$msg .= "Sender's E-mail:\t$_POST[sneder_email]\n";$msg .= "Message:\t$_POST[message]\n";$to = "scpad@att.net";$subject = "Web site Feedback";$mailheaders = "From: My Website <scpad@att.net>\n";$mailheaders .= "Reply-To: $_POST[sender_email]\n";mail($to, $subject, $msg, $mailheaders);?><html><head><title>Simple Feedback Form Sent</title></head><body><p><h1> The following e-mail has been sent:</h1></p><p><strong>Your Name:</strong><br><? echo "$_POST[sender_name]"; ?></p><p><strong>Your E-Mail Address:</strong><br><? echo "$_POST[sender_email]"; ?></p><p><strong>Message:</strong><br><? echo "$_POST[message]"; ?></p></body></html>

Oh ya, if you need my html page i'll post it. Just let me know.thanks,youngwebmaster

Link to comment
Share on other sites

But i tested my script and it had problems
what kind of problems? what were the Error messages? did it send the email? have you checked in your Bulk and Spam folders? Are you using the Hosting email server?where is the code for the Form you are using?Help us help you, please.
Link to comment
Share on other sites

For the record, I'd suggest hMail Server as a mail server. I have yet to see another Windows mail server that is free while also having all of the features they have. Heck, it's open source even.As for the errors you have - yeah... what errors? What happens?

Link to comment
Share on other sites

Sorry about not giving more info. Here it is.MAIL SERVER: My mail server is fine. I use my isp's mail server because they have a port open for members.What the script does: It brings up an error message (displayed below in next post)What it's supose to do: Send form information though an email and bring up a confermation page saying that the email was sent. Along with showing what information was sent.The form script:

<html><head><title>Simple Feedback form</title></head><body><form method="post" action="send_simpleform.php"><p><strongYour Name:</strong><br><input type="text" name="sender_name" size="30"></p><p><strong>Your E-mail Address:</strong><br><input type="text" name="sender_email" size="30"></p><p><strong>Message:</strong><br><textarea name="message" cols=30 rows=5 wrap=virtual></textarea></p><p><input type="submit" name="submit" value="send this form"></p></form></body></html>

If you want my php script again here it is:

<?if (($_POST[sender_name] == "") ||	($_POST[sender_email] == "") ||	($_POST[message] == "")  {	header ("Location: simple_form.html");	exit;}$msg = "E-mail sent from scpadonline.com\n";$msg .= "Sender's Name:\t$_POST[sender_name]\n";$msg .= "Sender's E-mail:\t$_POST[sneder_email]\n";$msg .= "Message:\t$_POST[message]\n";$to = "scpad@att.net";$subject = "Web site Feedback";$mailheaders = "From: My Website <scpad@att.net>\n";$mailheaders .= "Reply-To: $_POST[sender_email]\n";mail($to, $subject, $msg, $mailheaders);?><html><head><title>Simple Feedback Form Sent</title></head><body><p><h1> The following e-mail has been sent:</h1></p><p><strong>Your Name:</strong><br><? echo "$_POST[sender_name]"; ?></p><p><strong>Your E-Mail Address:</strong><br><? echo "$_POST[sender_email]"; ?></p><p><strong>Message:</strong><br><? echo "$_POST[message]"; ?></p></body></html>

Link to comment
Share on other sites

Up to my EXTREMELY limited knowledge, a PHP script starts with <?php, while yours only has <?.
Yes there are 3 ways to start a php block.<?<?phpor<script language="php">
Link to comment
Share on other sites

What the script does: It brings up an error message (displayed below in next post)
Here is the error message:Warning: mail() [function.mail]: Failed to Receive in send_simpleform.php on line 16Fatal error: Maximum execution time of 30 seconds exceeded in send_simpleform.php on line 24
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...