Notice
Recent Posts
Recent Comments
Tags
- XSS방어
- asp.net dropdownlist
- 하드 윈도우 복사
- ASP.Net Core 404
- TempData
- javascript redirection
- 하드 마이그레이션
- asp.net core Select
- Mac Oracle
- SSD 복사
- simpe ftp
- 원격ftp
- jquery 바코드생성
- ViewData
- ViewBag
- php 캐쉬제거
- JavaScript
- 맥 오라클설치
- 말줄임표시
- XSS PHP
- 강제이동
- 타임피커
- javascript 바코드 생성
- 바코드 생성하기
- asp.net Select
- asp ftp
- swagger 500 error
- django 엑셀불러오기
- asp.net core swagger
- 404에러페이지
웹개발자의 기지개
[ASP] 메일발송하기 - 네이버 SMTP 설정하기 포함 본문
보통의 경우 메일발송할때 자체 서버에서 메일서버를 셋팅해서 운영하면 스팸처리되어 제대로 수신이 안되는 경우가 허다하게 발생한다.
이러한 경우에 흔히 다음 메일서버나 구글메일서버의 smtp 를 이용하면 깔끔하게 수신처리됨을 알 수 있다.
|
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
|
<%
Function MailDelivery(fAdd, tAdd, mCon, mSub)
Dim SendMail
Dim SendConf
Dim SendField
Set SendMail = Server.CreateObject("CDO.Message")
Set SendConf = Server.CreateObject("CDO.Configuration")
Set SendField = SendConf.Fields
SendField("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
SendField("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.daum.net"
SendField("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
SendField("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
SendField("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
SendField("http://schemas.microsoft.com/cdo/configuration/sendusername") = "아이디"
SendField("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "비번"
SendField.Update
With SendMail
Set .Configuration = SendConf
.From = fAdd
.To = tAdd
.Subject = mCon
.HTMLBody = mSub
.Send
End With
Set SendMail = Nothing
Set SendField = Nothing
Set SendConf = Nothing
End Function
fAdd = "보내는 메일"
tAdd = "받는 메일"
mSub = "임시 비밀번호 발급 안내입니다."
mCon = "내용입니다."
Call MailDelivery(fAdd, tAdd, mSub, mCon)
%>
|
cs |
네이버 SMTP 이용
|
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
|
<%
toReceive = "받는이메일주소"
mCon = "발급된 임시 비밀번호는 1111 입니다."
mSub = "임시 비밀번호 발급 안내입니다."
Set objCMsg = Server.CreateObject("CDO.message")
Set iConf = Server.CreateObject("CDO.Configuration")
strschema = "http://schemas.microsoft.com/cdo/configuration/"
With iConf.Fields
.item(strschema & "sendusing") = 2
.item(strschema & "smtpserverport") = 465
.item(strschema & "smtpserver") = "smtp.naver.com"
.item(strschema & "smtpusessl") = 1
.item(strschema & "sendusername") = "이메일주소"
.item(strschema & "sendpassword") = "비밀번호0"
.item(strschema & "smtpauthenticate") = 1
.Item(strschema & "smtpconnectiontimeout") = 60
.Update
End With
Set objCMsg.Configuration = iConf
objCMsg.From = "보내는사람이메일"
objCMsg.To = toReceive
objCMsg.subject = mSub
objCMSg.BodyPart.Charset="utf-8"
objCMsg.HTMLbody = mCon
objCMSg.HTMLBodyPart.Charset="utf-8"
objCMsg.Send
set objCMsg = nothing
Set iConf = Nothing
%>
|
cs |
네이버 SMTP 를 이용시 아래와 같이 설정을 하도록 하자.


'ASP' 카테고리의 다른 글
| [ASP] 네이버에디터로 글 내용 수정시 소스태그로 에러날때 - 따옴표처리 (0) | 2021.04.13 |
|---|---|
| [ASP] VBScript runtime error '800a0006' Overflow 에러 대처법 (0) | 2020.11.21 |
| [ASP] 모바일인지 pc인체 체크하기 (0) | 2020.10.18 |
| [ASP] ActiveX component can't create object: 'MSXML2.DOMDocument 4.0' 에러처리 (0) | 2020.10.12 |
| [ASP] 3초후 페이지 로딩하기 (페이지 로딩 지연시키기) (0) | 2020.06.13 |
Comments