⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendmail.c

📁 使用Oracle 外部過程發送email, 有裝java組件的Oracle不需要.
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include "smtp.h"/*#include "debug/global.h" */#define SMTPPORT 25/*//Write By Gan Jian Hui//Date : 2006-07-06//Description :Send email by c */#ifdef  ORACLEPROC int sendMail(    char *subject,    char *message,    char *from,    char *recipient)#elseint main(int argc,char *argv[]) #endif	{		int   sockfd ;	char *mailserver;	char mailfrom[80]="" ;	char *hostname ;	pMail mail ;	hostname =(char *)malloc(80) ;	memset(hostname,0,80) ;	gethostname(hostname,80) ;	mailserver = "mailserver" ;	INIT_MAIL(mail);	sprintf(mailfrom,"%s@%s","admin",hostname) ;	free(hostname) ;#ifdef ORACLEPROC	mail->subject  = strdup(subject) ;	mail->mailBody = strdup(message) ;	mail->header->mailTo = strdup(recipient );	mail->header->mailFrom=strdup(mailfrom );#else	mail->subject=strdup("thisistest簙

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -