LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   I need to send email from PHP - How can I do this easily? (https://www.linuxquestions.org/questions/ubuntu-63/i-need-to-send-email-from-php-how-can-i-do-this-easily-459738/)

wadesmart 06-30-2006 08:33 AM

I need to send email from PHP - How can I do this easily?
 
06302006 0829 GMT-6

This new thread was acting started as another one but, this more explains what is wrong.

Im working on fixing the local public schools messed up online system. A lot of the online apps need to be able to send mail. I havent wrote any code to send mail before - mainly because getting it all set up has always been a pain.

I want to have the ability to test the apps that I build on my computer so, I want to set this up. All my books say sendmail but I was told Ubuntu uses Postfix. I read some of the documentation and I just do not understand.

This is what I want to do. I want to send email to my own email account for testing. Is this possible?

Isnt there an easy way to do this?

Wade

cdhgee 06-30-2006 09:11 AM

Check out the mail function.

BTW, this should have been posted in the Programming forum, not the Ubuntu forum as this is not specific to Ubuntu.

wadesmart 06-30-2006 10:31 AM

Well, it is a programming question but its not the programming part that I need help with.

I know about the php mail function. I used it and nothing happened. After some searching I found in my mail log:

Jun 30 08:08:09 localhost postfix/smtp[26616]: 8E31018B41F: to=<wade@wadesmart.com>, relay=none, delay=215374, status=deferred (Host or domain name not found. Name service error for name=wadesmart.com type=MX: Host not found, try again)

So, isnt this a mail question? If not - then Im sorry for the incorrectly posting in the wrong forum.

Its just getting some mail application to simply send some mail so I can get back to work.

Wade

cdhgee 06-30-2006 02:22 PM

Ah, I misinterpreted exactly what your problem was from what you said in your first post - apologies.

The error message suggests that Postfix can't find the MX records for wadesmart.com (which do exist, I've just checked). Which either means that (a) your DNS isn't working correctly or (b) your network connection isn't working correctly.

Try running the following command manually from a terminal - do you get the following?

Code:

[david@malvern ~]$ nslookup -type=mx wadesmart.com
Server:        xxx.xx.xxx.xxx
Address:        xxx.xxx.xxx.xxx#53

Non-authoritative answer:
wadesmart.com  mail exchanger = 50 mailstore1.secureserver.net.
wadesmart.com  mail exchanger = 10 smtp.secureserver.net.


wadesmart 06-30-2006 07:06 PM

Well, there wouldnt be for wadesmart.com. I have that domain for my email only, and its hosted at Godaddy.


Stop. Lets start again.

My computer runs Ubuntu 5.10. I am working on some apps for the school and I have to be able to test the pages that send mail.

How can I do this from my system? I know that I have postfix on my system. I do not know how to set that up. Is there an easy way to do this?

Wade

wadesmart 06-30-2006 07:23 PM

Sorry, forgot to answer your question.

when I type nslook I get my current ip address for server and address. ** server cant find wadesmart.com NOTIMP

wade

cdhgee 07-06-2006 03:15 AM

Have you got postfix installed? If so, it should pretty much work out of the box.

Can you try using your PHP page to send an e-mail to a domain which will have ultra-reliable DNS such as gmail.com or hotmail.com and see if that works? That will help us establish whether it's all DNS resolution that doesn't work, or just some domains, or something else entirely.


All times are GMT -5. The time now is 03:47 PM.