Send and Email

Send and Email

sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
How do you send an email in php? I've tried everything I found on google.

mail();
download sendmail
apt-get install a smtp server
some random php scripts
gmail

I'm at a loss.
 
 
 
2011 Dec 17 at 23:31 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
I just use mail(). You need your sendmail server installed and running though.

What does it say if you
code
service sendmail status
?

Also, where are you sending the mail to? It could be getting filtered.
 
 
 
2011 Dec 19 at 08:06 UTC — Ed. 2011 Dec 19 at 08:07 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
I still think you should go the smtp route...
 
 
 
2011 Dec 19 at 09:35 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
code
mike@ubuntuServer:~$ service sendmail status
MSP: is run via cron (20m)
tail: cannot open `/var/run/sendmail/mta/sendmail.pid' for reading: Permission denied
MTA:
ERROR: List of process IDs must follow -p.
********* simple selection ********* ********* selection by list *********
-A all processes -C by command name
-N negate selection -G by real group ID (supports names)
-a all w/ tty except session leaders -U by real user ID (supports names)
-d all except session leaders -g by session OR by effective group name
-e all processes -p by process ID
T all processes on this terminal -s processes in the sessions given
a all w/ tty, including other users -t by tty
g OBSOLETE -- DO NOT USE -u by effective user ID (supports names)
r only running processes U processes for specified users
x processes w/o controlling ttys t by tty
*********** output format ********** *********** long options ***********
-o,o user-defined -f full --Group --User --pid --cols --ppid
-j,j job control s signal --group --user --sid --rows --info
-O,O preloaded -o v virtual memory --cumulative --format --deselect
-l,l long u user-oriented --sort --tty --forest --version
-F extra full X registers --heading --no-heading --context
********* misc options *********
-V,V show version L list format codes f ASCII art forest
-m,m,-L,-T,H threads S children in sum -y change -l format
-M,Z security data c true command name -c scheduling class
-w,w wide output n numeric WCHAN,UID -H process hierarchy

So I followed this:
Quote:
So I renamed the sendmail.pid in sendmail.in.pid, chowned it to root smmsp, and it works. Sendmail status tells me that everything is ok.
Brian: thank you for the idea.
Best wishes from Cologne.

And the result is now this:
code
mike@ubuntuServer:~$ service sendmail status MSP: is run via cron (20m)
MTA: 807 /usr/sbin/sendmail-mta -Am -L sm-mta -bd -q10m
UID PID PPID C STIME TTY TIME CMD
root 807 1 0 Dec18 ? 00:00:01 sendmail: MTA: accepting connections
Daemon Status: Sendmail is running but not answering status queries.
No response
QUE: Same as MTA
 
 
 
2011 Dec 19 at 15:34 UTC — Ed. 2011 Dec 19 at 17:05 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
sudo
 
 
 
2011 Dec 19 at 17:04 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Rockbomb said:
sudo

STFU

Also:
code
mike@ubuntuServer:~$ echo hello |sendmail -v me1435@hotmail.com
me1435@hotmail.com... Connecting to [127.0.0.1] via relay...
220 ubuntuServer.westell.com ESMTP Sendmail 8.14.4/8.14.4/Debian-2ubuntu2; Mon, 19 Dec 2011 12:27:48 -0500; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]
>>> EHLO ubuntuServer.westell.com
250-ubuntuServer.westell.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<mike@ubuntuServer.westell.com> SIZE=6 AUTH=mike@ubuntuServer.westell.com
250 2.1.0 <mike@ubuntuServer.westell.com>... Sender ok
>>> RCPT To:<me1435@hotmail.com>
>>> DATA
250 2.1.5 <me1435@hotmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .

 
 
 
2011 Dec 19 at 17:06 UTC — Ed. 2011 Dec 19 at 17:31 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
Have you tried any of
code

service sendmail stop
service sendmail start
service sendmail restart


I would not trust moving the pid file around to work.
 
 
 
2011 Dec 20 at 02:35 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
Did it just hang after your
code
echo hello |sendmail -v me1435@hotmail.com
or did it eventually do something?

You should try sending mail somewhere other than hotmail, too. I think most of the big email providers are pretty picky about who they accept mail from.

And how many firewalls are you behind?
 
 
 
2011 Dec 20 at 02:44 UTC — Ed. 2011 Dec 20 at 02:44 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
sprinkles said:
code
mike@ubuntuServer:~$ service sendmail status
MSP: is run via cron (20m)
tail: cannot open `/var/run/sendmail/mta/sendmail.pid' for reading: Permission denied


Rockbomb said:
sudo


Actually I get the same error if I don't run sudo there. With sudo I get:
code

$ sudo /sbin/service sendmail status
sendmail (pid 4466) is running...
 
 
 
2011 Dec 20 at 02:51 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
superjer said:
Did it just hang after your
code
echo hello |sendmail -v me1435@hotmail.com
or did it eventually do something?

You should try sending mail somewhere other than hotmail, too. I think most of the big email providers are pretty picky about who they accept mail from.

And how many firewalls are you behind?

code
050 <7195572385@txt.att.net>... Connecting to mx.cingularme.com. via esmtp...
050 <7195572385@txt.att.net>... Deferred: Connection timed out with mx.cingularme.com.
250 2.0.0 pBK6VH94005379 Message accepted for delivery
7195572385@txt.att.net... Sent (pBK6VH94005379 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 ubuntuServer.westell.com closing connection


Does it matter that I don't have a domain name yet?
 
 
 
2011 Dec 20 at 06:32 UTC — Ed. 2011 Dec 20 at 06:40 UTC
SRAW
Rocket Man

2007 Nov 6 • 2525
601 ₧
Free Steam Games
 
 
 
2011 Dec 20 at 07:42 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
You don't need a domain but it helps if your reverse DNS is correct. (It can be a subdomain.)
 
 
 
2011 Dec 28 at 11:50 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧

Is that right?
 
 
 
2012 Jan 4 at 19:11 UTC
Page [1]