팁] php로 gmail 계정 주소를 사용해 email 그림 만들기
글쓴이: 송지석 / 작성시간: 월, 2004/10/11 - 3:42오후
스팸에 노출될까봐 그림으로 만들면 좀 나을까 싶어 만들어봤습니다.
http://mimosa.snu.ac.kr/~rommance/stuffs/eml2img/
에서 확인해보실 수 있고요. 제 개인 계정입니다.
혹시 못 믿겠다 싶으신 분들은 제가 소스를 올려드릴테니 php 사용되는 곳에 깔고 사용하시죠..
index.php와 eml2img.php, gmail.png 파일이 있으면 됩니다.
폰트라던가 디자인은 잘 못하겠군요. 혹시 예쁘게 만드실 분 있으시면 고쳐서 올려주시면 감사하겠습니다.
소스 : index.php
<html>
<body>
Made by Daniel J. Song
<br>
email address image maker
<form name="id_form" action="index.php" method="get">
Your gmail address?
<input type="text" name="id" size="15" />
</form>
<?php
@extract($HTTP_GET_VARS);
if ($id)
echo '<img src="eml2img.php?id=', $id ,'" alt="', $id, '@gmail.com" align="top" />';
?>
</body>
<html>
eml2img.php
<?php
/* email to image converter for gmail.
by Daniel Jiseok Song
2004-10-11
*/
@extract($HTTP_GET_VARS); // id 변수 가져옵니다.
if (!$id)
$id="yourname";
$at = "@";
$server = ".com";
$font = 5;
$width = ImageFontWidth($font) * (strlen($id) + strlen($at) + strlen($server));
$height = ImageFontHeight($font);
$icon_img = imagecreatefrompng("gmail.png");
$src_w = imagesx($icon_img);
$src_h = imagesy($icon_img);
//echo $src_w,",",$src_h;
$width = $width + $src_w;
$height = MAX($height , $src_h);
$im = @imagecreate($width, $height);
$im2 = @imagecreate($width, $height);
$bcolor = imagecolorallocate($im, 255, 255, 255); //white background
$bcolor2 = imagecolorallocate($im2, 255, 255, 255); //white background
$idcolor = imagecolorallocate($im, 102, 102,102); //id color
$atcolor = imagecolorallocate($im, 255, 153, 153); // @ color
$svcolor = imagecolorallocate($im, 88,162,208); // server color
imagestring($im, $font, 0, $height - ImageFontHeight($font), $id, $idcolor);
$swidth = ImageFontWidth($font) * strlen($id);
imagestring($im, $font, $swidth+2, $height - ImageFontHeight($font), $at, $atcolor);
$swidth = ImageFontWidth($font) * (strlen($id) + strlen($at));
imagecopymerge($im, $icon_img, $swidth+2, 0, 0, 0, $src_w, $src_h, 100);/* gmail 아이콘에 투명도를 줄 수 있습니다. */
$swidth += $src_w;
imagestring($im, $font, $swidth-2, $height - ImageFontHeight($font), $server, $svcolor);
imagecopymerge($im2, $im, 0, 0, 0, 0, $width, $height, 80);/* 전체에 투명도를 80 줍니다.*/
header ("Content-type: image/png");
imagepng($im2);
?>
File attachments:
| 첨부 | 파일 크기 |
|---|---|
| 1.25 KB |
Forums:


와.. 멋진데요.. 수고하셨습니다.. ^^;폰트.. 지금 그대로도 이
와.. 멋진데요.. 수고하셨습니다.. ^^;
폰트.. 지금 그대로도 이쁜데요..
Since 2003.
지금은 맥유저...
---
http://jtjoo.com
송지석님 수고 많으셨어요.. 감사합니다~~
송지석님 수고 많으셨어요.. 감사합니다~~
Life rushes on, we are distracted
댓글 달기