sendmail-via-smtp
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?PHP
######################################################################
## ##
## THIS IS AN SCRIPT FOR LEARNING PURPOSES ##
## YOU MAY USE AND DISTRIBUTE IT AS LONG AS THIS ##
## COMMENT FIELD IS IN IT OR YOU LINK TO SOURCESHOCK.COM ##
## ##
## ##
######################################################################
$socket = fsockopen("127.0.0.1","25");
fwrite($socket,"HELO servername.coml\r\n");
$buf = fgets($socket,1024) . "<br>";
fwrite($socket,"MAIL FROM: yourname\r\n");
$buf .= fgets($socket,1024) . "<br>";
fwrite($socket,"RCPT TO: <[email protected]>\r\n");
fwrite($socket,"DATA\r\n");
$buf .= fgets($socket,2024) . "<br>";
$time = time();
$uur = strftime("%H",$time);
$min = strftime("%M",$time);
$headers = "MIME-Version:1.0\n";
$headers .= "Content-Type:text/html;charset=iso-8859-1\n";
$headers .= "Subject: blaat\r\n";
$headers .= "From: mailtest<yourmail@email>\r\n";
$body = "<font face=verdana color=blue>test</font>";
fwrite($socket,"$headers\n\n$body\r\n.\r\n");
fwrite($socket,"QUIT\r\n");
$buf .= fgets($socket,1024) . "<br>";
$buf .= fgets($socket,1024) . "<br>";
echo $buf;
fclose($socket);
?>
######################################################################
## ##
## THIS IS AN SCRIPT FOR LEARNING PURPOSES ##
## YOU MAY USE AND DISTRIBUTE IT AS LONG AS THIS ##
## COMMENT FIELD IS IN IT OR YOU LINK TO SOURCESHOCK.COM ##
## ##
## ##
######################################################################
$socket = fsockopen("127.0.0.1","25");
fwrite($socket,"HELO servername.coml\r\n");
$buf = fgets($socket,1024) . "<br>";
fwrite($socket,"MAIL FROM: yourname\r\n");
$buf .= fgets($socket,1024) . "<br>";
fwrite($socket,"RCPT TO: <[email protected]>\r\n");
fwrite($socket,"DATA\r\n");
$buf .= fgets($socket,2024) . "<br>";
$time = time();
$uur = strftime("%H",$time);
$min = strftime("%M",$time);
$headers = "MIME-Version:1.0\n";
$headers .= "Content-Type:text/html;charset=iso-8859-1\n";
$headers .= "Subject: blaat\r\n";
$headers .= "From: mailtest<yourmail@email>\r\n";
$body = "<font face=verdana color=blue>test</font>";
fwrite($socket,"$headers\n\n$body\r\n.\r\n");
fwrite($socket,"QUIT\r\n");
$buf .= fgets($socket,1024) . "<br>";
$buf .= fgets($socket,1024) . "<br>";
echo $buf;
fclose($socket);
?>