메일함수로 게시물 등록시 특정인에게 이메일 발송하기

· 2010-11-05 (금) 14:04:28 · 2113 · 12
안녕하세요?

제가 연후아빠님이 올려주신 쇼핑몰 스킨을 사용하고 있는데요 상품 구매가 완료 되었을때
내용을 이메일로 발송하게 하려고 곱슬최씨님이 올려주신 게시물 작성시 특정인에게 이메일 발송하기를 보고 게시판의 order_u.php, orderlist.php에
메일함수
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

////////////////////////////////////////////////
// 받을 사람의 이메일주소를 넣어주세요.

$emails[] = "[email protected]"; // 이메일주소1
$emails[] = "[email protected]"; // 이메일주소2
$emails[] = "[email protected]"; // 이메일주소3
$emails[] = "[email protected]"; // 이메일주소4
$emails[] = "[email protected]"; // 이메일주소5
$emails[] = "[email protected]"; // 이메일주소6

// 계속 추가할 수 있습니다.
////////////////////////////////////////////////

if ($w == '')
{
$row = sql_fetch("select * from $write_table where wr_id = '$wr_id'");

$wr_subject = get_text(stripslashes($row[wr_subject]));

$tmp_html = 0;
if (strstr($row[wr_option], "html1"))
$tmp_html = 1;
else if (strstr($row[wr_option], "html2"))
$tmp_html = 2;

$wr_content = conv_content(stripslashes($row[wr_content]), $tmp_html);
$wr_name = $row[wr_name];

$subject = "'{$board[bo_subject]}' 게시판에 글이 올라왔습니다.";
$link_url = "$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table&wr_id=$wr_id&$qstr";


include_once("$g4[path]/lib/mailer.lib.php");

ob_start();
include_once ("./write_update_mail.php");
$content = ob_get_contents();
ob_end_clean();

foreach($emails as $email)
{
if ($email)
mailer($wr_name, $wr_email, $email, $subject, $content, 1);
}
}
?>
해보았는데 메일이 안오더군요 테스트메일이나 인증메일은 잘 작동되고 있습니다.

메일이 오게하려면 이 코드를 어디에 넣어야 하나요?

도와주세요

스킨링크
http://sir.co.kr/bbs/board.php?bo_table=g4_skin_board&wr_id=23254&sca=&sfl=wr_subject&stx=%BC%EE%C7%CE&sop=and










꼭!!!!
감사합니다.

첨부파일

shop_mall.zip (329.3 KB) 8회 2010-11-05 14:04
|

댓글 12개

2010-11-05 (금) 14:32:26
올리신 소스를 토대로 설명드리자면..
foreach($emails as $email)
{
if ($email)
mailer($wr_name, $wr_email, $email, $subject, $content, 1);
}

상위 내용이 배열을 처리하여 메일을 보내도록 되어 있으므로..
흑금성님께서 잘못 이해하신 부분은 다음과 같습니다.

$emails[] = "<A href="mailto:[email protected]" target=_blank>[email protected]</A>"; // 이메일주소1
$emails[] = "<A href="mailto:[email protected]" target=_blank>[email protected]</A>"; // 이메일주소2
$emails[] = "<A href="mailto:[email protected]" target=_blank>[email protected]</A>"; // 이메일주소3
$emails[] = "<A href="mailto:[email protected]" target=_blank>[email protected]</A>"; // 이메일주소4
$emails[] = "<A href="mailto:[email protected]" target=_blank>[email protected]</A>"; // 이메일주소5
$emails[] = "<A href="mailto:[email protected]" target=_blank>[email protected]</A>"; // 이메일주소6

수정후
$emails[] = "[email protected]"; // 이메일주소1
$emails[] = "[email protected]"; // 이메일주소2

또는
$emails[] = "테스트1<[email protected]>"; // 이메일주소1
$emails[] = "테스트2<[email protected]>"; // 이메일주소2
2010-11-05 (금) 14:52:28
code 를 씌우니까 글어온글에 링크가 생겼어요 ㅜㅜ

제가 확인 했어야하는데 죄송합니다.
2010-11-05 (금) 17:36:35
ㅎㅎ 씹혔당..
order_u.php 파일에 넣으세요.

$sql = " INSERT INTO {$write_table}_order
SET mb_id = '$member[mb_id]',
wr_id = '$wr_id',
od_name = '$od_name',
od_qty = '$od_qty',
od_price = '$od_price',
od_total_price = '$od_total_price',
od_tel = '$od_tel',
od_hp = '$od_hp',
od_zip1 = '$od_zip1',
od_zip2 = '$od_zip2',
od_addr1 = '$od_addr1',
od_addr2 = '$od_addr2',
od_bank_use = '$od_bank_use',
od_memo = '$od_memo',
od_datetime = '$g4[time_ymdhis]' ";
sql_query($sql);

// 받을 사람의 이메일주소를 넣어주세요.
$emails[] = "[email protected]"; // 이메일주소1
$emails[] = "[email protected]"; // 이메일주소2
$emails[] = "[email protected]"; // 이메일주소3
$emails[] = "[email protected]"; // 이메일주소4
$emails[] = "[email protected]"; // 이메일주소5
// 계속 추가할 수 있습니다.

$row = sql_fetch("select * from $write_table where wr_id = '$wr_id'");
$wr_subject = get_text(stripslashes($row[wr_subject]));
$tmp_html = 0;

if (strstr($row[wr_option], "html1"))
$tmp_html = 1;
else if (strstr($row[wr_option], "html2"))
$tmp_html = 2;

$wr_content = conv_content(stripslashes($row[wr_content]), $tmp_html);
$wr_name = $row[wr_name];
$subject = "'{$board[bo_subject]}' 게시판에 글이 올라왔습니다.";
$link_url = "$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table&wr_id=$wr_id&$qstr";

include_once("$g4[path]/lib/mailer.lib.php");
ob_start();
include_once ("./write_update_mail.php");
$content = ob_get_contents();
ob_end_clean();

foreach($emails as $email)
{
if ($email)
mailer($wr_name, $wr_email, $email, $subject, $content, 1);
}

alert("구매신청완료 되었습니다.","$g4[bbs_path]/board.php?bo_table=$bo_table");

?>
2010-11-05 (금) 15:03:23
<?
include_once "_common.php";
//************************************************************
//
// 스킨명 : 카멜레온 간이몰 스킨
// 버 젼 : 2006-03-16일짜 버젼
// 제작자 : ⓒⓒⓒ (Soonho Choi) http://cm-builder.com
// MSN : [email protected]
//
// 저작권 : 이 주석 부분을 훼손하지 상태에서 수정및 사용이 자유롭습니다.
//
//************************************************************
//
// 스킨명 : 간이몰 스킨 1v
// 수 정 : 2006-07-29일
// 수정자 : 스펙트럼 (toptalent) http://spectrum-enter.com/YBH/
// E-mail : [email protected]
//
// 저작권 : 이 주석 부분을 훼손하지않은 상태에서 수정및 사용이 자유롭습니다.
//
//************************************************************

이거 아래부터 넣는거 맞죠?
근데 메일은 안오네요 그리고 테스트 메일 잘들어가면 메일에는 문제가 없는거 같은데 안되네요 ㅠㅠ
2010-11-05 (금) 15:19:09
include_once ("./write_update_mail.php"); 어떤분이 경로문제 라고 하셔서
include_once ("$g4[url]/$g4[bbs]//write_update_mail.php");
include_once ("../../bbs/write_update_mail.php");
include_once ("$g4[path]/bbs/write_update_mail.php"); 이렇게 바꿔봤는데 ㅜㅜ
테스트 후 다시 올립니다. 메일이 정상적으로 발송되는것을 확인하였습니다.

order_u.php 파일입니다.

<?
include_once "_common.php";
//************************************************************
//
// 스킨명 : 카멜레온 간이몰 스킨
// 버 젼 : 2006-03-16일짜 버젼
// 제작자 : ⓒⓒⓒ (Soonho Choi) http://cm-builder.com
// MSN : [email protected]
//
// 저작권 : 이 주석 부분을 훼손하지 상태에서 수정및 사용이 자유롭습니다.
//
//************************************************************
//
// 스킨명 : 간이몰 스킨 1v
// 수 정 : 2006-07-29일
// 수정자 : 스펙트럼 (toptalent) http://spectrum-enter.com/YBH/
// E-mail : [email protected]
//
// 저작권 : 이 주석 부분을 훼손하지않은 상태에서 수정및 사용이 자유롭습니다.
//
//************************************************************

$sql = " INSERT INTO {$write_table}_order
SET mb_id = '$member[mb_id]',
wr_id = '$wr_id',
od_name = '$od_name',
od_qty = '$od_qty',
od_price = '$od_price',
od_total_price = '$od_total_price',
od_tel = '$od_tel',
od_hp = '$od_hp',
od_zip1 = '$od_zip1',
od_zip2 = '$od_zip2',
od_addr1 = '$od_addr1',
od_addr2 = '$od_addr2',
od_bank_use = '$od_bank_use',
od_memo = '$od_memo',
od_datetime = '$g4[time_ymdhis]' ";
sql_query($sql);

// 받을 사람의 이메일주소를 넣어주세요.
$emails[] = "[email protected]"; // 이메일주소1
// 계속 추가할 수 있습니다.

$row = sql_fetch("select * from $write_table where wr_id = '$wr_id'");
$wr_subject = get_text(stripslashes($row[wr_subject]));
$tmp_html = 0;

if (strstr($row[wr_option], "html1"))
$tmp_html = 1;
else if (strstr($row[wr_option], "html2"))
$tmp_html = 2;

$wr_content = conv_content(stripslashes($row[wr_content]), $tmp_html);
$wr_name = $row[wr_name]; // 보내는 사람 이름
$wr_email = $row[wr_email]; // 보내는 사람 이메일
$subject = "'{$board[bo_subject]}' 게시판에 글이 올라왔습니다."; // 메일 제목
$link_url = "$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table&wr_id=$wr_id&$qstr";

include_once("$g4[path]/lib/mailer.lib.php");
ob_start();
include_once ("$g4[bbs_path]/write_update_mail.php");
$content = ob_get_contents();
ob_end_clean();

foreach($emails as $email)
{
if ($email)
mailer($wr_name, $wr_email, $email, $subject, $content, 1);
}

alert("구매신청완료 되었습니다.","$g4[bbs_path]/board.php?bo_table=$bo_table");

?>
2010-11-05 (금) 15:27:29
여러개의 게시판에 orderlist.php 에 게시물들을 하나의게시판이나 최근 게시물로 불러올수는 없을까요?
2010-11-05 (금) 15:32:12
방긋님 감사합니다.

아직 성공은 못했지만 그누 다시 셋업하고 시도해보겠습니다.

안되면 쪽지좀 받아주실수 있는지요 ?
네~ :)
2010-11-05 (금) 21:47:17
성공했어요 감사합니다.
2010-11-05 (금) 16:06:57
중때린수녀님도 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
10-11-06 조회 902
10-11-06 조회 1,051
10-11-06 조회 1,095
10-11-05 조회 1,118
10-11-05 조회 1,608
10-11-05 조회 1,450
10-11-05 조회 1,415
10-11-05 조회 1,749
10-11-05 조회 1,124
10-11-05 조회 1,047
10-11-05 조회 2,347
10-11-05 조회 2,576
10-11-05 조회 832
10-11-05 조회 1,609
10-11-05 조회 2,140
10-11-05 조회 1,119
10-11-05 조회 2,114
10-11-05 조회 1,127
10-11-05 조회 1,307
10-11-05 조회 1,121