팁] php로 gmail 계정 주소를 사용해 email 그림 만들기

송지석의 이미지

스팸에 노출될까봐 그림으로 만들면 좀 나을까 싶어 만들어봤습니다.

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: 
첨부파일 크기
Image icon gmail.png1.25 KB
Forums: 
shyxu의 이미지

와.. 멋진데요.. 수고하셨습니다.. ^^;
폰트.. 지금 그대로도 이쁜데요..

Since 2003.
지금은 맥유저...
---
http://jtjoo.com

yielding의 이미지

송지석님 수고 많으셨어요.. 감사합니다~~

Life rushes on, we are distracted

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.