# PROP Ignore_Export_Lib 0\r
# PROP Target_Dir ""\r
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /c\r
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "ZTS" /D "NDEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /D HAVE_IMAP2001=1 /FR /YX /FD /c\r
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\imap\c-client" /D "ZTS" /D "NDEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /D HAVE_IMAP2001=1 /FR /YX /FD /c\r
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
# ADD BASE RSC /l 0x40d /d "NDEBUG"\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\r
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib wsock32.lib winmm.lib cclient.lib Secur32.lib CertIdl.Lib /nologo /dll /machine:I386 /nodefaultlib:"LIBCMT" /out:"..\..\Release_TS/php_imap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"\r
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib wsock32.lib winmm.lib cclient.lib Secur32.lib CertIdl.Lib /nologo /dll /machine:I386 /nodefaultlib:"LIBCMT" /out:"..\..\Release_TS/php_imap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\imap"\r
+# SUBTRACT LINK32 /nodefaultlib\r
\r
!ENDIF \r
\r
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
# Begin Source File\r
\r
-SOURCE=..\..\win32\imap_sendmail.c\r
-# End Source File\r
-# Begin Source File\r
-\r
SOURCE=.\php_imap.c\r
# End Source File\r
# Begin Source File\r
# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
# Begin Source File\r
\r
-SOURCE=..\..\win32\imap_sendmail.h\r
-# End Source File\r
-# Begin Source File\r
-\r
SOURCE=.\php_imap.h\r
# End Source File\r
# Begin Source File\r
#include <signal.h>
#ifdef PHP_WIN32
-#include "winsock.h"
-#include "win32/imap_sendmail.h"
+#include <winsock.h>
+#include <stdlib.h>
+#include "win32/sendmail.h"
MAILSTREAM DEFAULTPROTO;
#endif
#endif
#ifdef PHP_WIN32
- if (imap_TSendMail(INI_STR("SMTP"), &tsm_err, headers, subject, to, message, cc, bcc, rpath) != SUCCESS) {
+ char *tempMailTo;
+ ADDRESS *addr;
+ char *bufferCc = NULL, *bufferBcc = NULL;
+ int offset;
+
+ if (cc && *cc) {
+ tempMailTo = estrdup(cc);
+ bufferCc = (char *)emalloc(strlen(cc));
+ offset = 0;
+ addr = NULL;
+ rfc822_parse_adrlist(&addr, tempMailTo, NULL);
+ while (addr) {
+ if (strcmp(addr->host, ERRHOST) == 0)
+ return (BAD_MSG_DESTINATION);
+ else {
+ offset += sprintf(bufferCc + offset, "%s@%s,", addr->mailbox, addr->host);
+ }
+ addr = addr->next;
+ }
+ efree(tempMailTo);
+ bufferCc[offset] = 0;
+ }
+
+ if (bcc && *bcc) {
+ tempMailTo = estrdup(bcc);
+ bufferBcc = (char *)emalloc(strlen(bcc));
+ offset = 0;
+ addr = NULL;
+ rfc822_parse_adrlist(&addr, tempMailTo, NULL);
+ while (addr) {
+ if (strcmp(addr->host, ERRHOST) == 0)
+ return (BAD_MSG_DESTINATION);
+ else {
+ offset += sprintf(bufferBcc + offset, "%s@%s,", addr->mailbox, addr->host);
+ }
+ addr = addr->next;
+ }
+ efree(tempMailTo);
+ bufferBcc[offset] = 0;
+ }
+
+
+ if (TSendMail(INI_STR("SMTP"), &tsm_err, NULL, headers, subject, to, message, bufferCc, bufferBcc, rpath) != SUCCESS) {
php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), GetSMErrorText(tsm_err));
return 0;
}
+ if (bufferCc) efree(bufferCc);
+ if (bufferBcc) efree(bufferBcc);
#else
if (!INI_STR("sendmail_path")) {
return 0;