 |
|
 |
we want to send mail with unicode content.
Is it possible with this code?
Himanshu Manjarawala.
Sr. Software engineer @AutomationAnywhere
http://www.himanshumbi.blogspot.com
http://www.fieredotnet.wordpress.com
|
|
|
|
 |
|
 |
I'm using smtp.163.com for testing:
mail.SetSMTPServer("smtp.163.com", 25);
mail.SetSecurityType(NO_SECURITY);
mail.SetLogin("username@163.com");
mail.SetPassword("WrongPassword");
If the password is wrong, the smtp server would response:
"535 authentication failed"
And the code crashed like this:
535 authentication failed 1a0f0fac-bbf2-4f21-98e6-3598a92dad37
CSmtp.exe 中的 0x774bb9bc 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0018e8e8 处的 ECSmtp。
QUIT
CSmtp.exe 中的 0x774bb9bc 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0018dca8 处的 ECSmtp。
QUIT
CSmtp.exe 中的 0x774bb9bc 处最可能的异常: Microsoft C++ 异常: 内存位置 0x0018cf70 处的 ECSmtp。
...
...
CSmtp.exe 已触发了一个断点
线程 'Win32 线程' (0x2108) 已退出,返回值为 3 (0x3)。
|
|
|
|
 |
|
 |
how to send to multiple user
I try but gmail notify error
Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550-5.1.1 The email account that you tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 sp3si11314072pbc.35 (state 13).
|
|
|
|
 |
|
 |
Please help to get the 64bit version of libeay32.lib and ssleay32.lib. I am unable to find the same. Thanks in advance. Vikash Kr.
|
|
|
|
 |
|
|
 |
|
 |
Hi, you can change the charset from "US-ASCII" to "gb2312" in the function FormatHeader, as follows:
if(!Attachments.size())
{ // no attachments
if(m_bHTML) strcat(header,"Content-Type: text/html; charset=\"US-ASCII\"\r\n");
else strcat(header,"Content-type: text/plain; charset=\"US-ASCII\"\r\n");
strcat(header,"Content-Transfer-Encoding: 7bit\r\n");
strcat(SendBuf,"\r\n");
}
to
if(!Attachments.size())
{ // no attachments
if(m_bHTML) strcat(header,"Content-Type: text/html; charset=\"gb2312\"\r\n");
else strcat(header,"Content-type: text/plain; charset=\"gb2312\"\r\n");
strcat(header,"Content-Transfer-Encoding: 7bit\r\n");
strcat(SendBuf,"\r\n");
}
Thanks!
|
|
|
|
 |
|
 |
Thank you for your assistance in dealing with this problem!
It's OK
|
|
|
|
 |
|
|
 |
|
 |
I've detected a small bugIn the CSmtp::FormatHeader function. When there's no m_sNameFrom the header says the it's been sent by mail@domain.com.
The bug is here:
if(!m_sMailFrom.size())
throw ECSmtp(ECSmtp::UNDEF_MAIL_FROM);
strcat(header,"From: ");
if(m_sNameFrom.size())
strcat(header, m_sNameFrom.c_str());
strcat(header," <");
if(m_sNameFrom.size())
strcat(header,m_sMailFrom.c_str());
else
strcat(header,"mail@domain.com");
strcat(header, ">\r\n");
It can be solved like this. There is no point of changing the if since we already have checked that m_sMailFrom has value.
if(!m_sMailFrom.size()) throw ECSmtp(ECSmtp::UNDEF_MAIL_FROM);
strcat(header,"From: ");
if(m_sNameFrom.size()) strcat(header, m_sNameFrom.c_str());
strcat(header," <");
strcat(header,m_sMailFrom.c_str());
strcat(header, ">\r\n");
|
|
|
|
 |
|
|
 |
|
 |
Hello,
Am having problem compiling, can you give some help.
Compiling...
base64.cpp
CSmtp.cpp
main.cpp
c:\documents and settings\admin\my documents\csmtp_v2_0_ssl\csmtp_v2_0_ssl\main.cpp(16) : error C2039: 'USE_TLS' : is not a member of 'CSmtp'
c:\documents and settings\admin\my documents\csmtp_v2_0_ssl\csmtp_v2_0_ssl\csmtp.h(164) : see declaration of 'CSmtp'
md5.cpp
Generating Code...
An it pointing to the bold line
#if defined(test_gmail_tls)
mail.SetSMTPServer("smtp.gmail.com",587);
mail.SetSecurityType(CSmtp::USE_TLS);
#elif defined(test_gmail_ssl)
How can i convert this project to c#
Regards
modified 7 Feb '12.
|
|
|
|
 |
|
 |
I am not using main.cpp for my work (I have my own main), but it appears that...
1.9 and earlier USE_TLS was in class CSmtp
2.0 USE_TLS is now outside the class
Try this
#if defined(test_gmail_tls)
mail.SetSMTPServer("smtp.gmail.com",587);
mail.SetSecurityType(USE_TLS);
#elif defined(test_gmail_ssl)
|
|
|
|
 |
|
 |
Thanks for responding, am trying to compile this into a dll, so i can use it in my c# app, how do i do this?
Wh i compiled, i get a CSmtp.exe in the debug directory. Honestly, am no good in vc++, but i am average programmer in c# and java etc just not c++. if you can provide a link to building and compiling vc++ projects, i'd appreciate it
regards
|
|
|
|
 |
|
 |
Sorry, can't help you there.
No experience with building .dlls.
Haven't even looked at the VisualStudio solution/project for this... I am working in Linux.
However, VisualStudio... if your can sort out dlls in C#, it shouldn't be too different in C++?
|
|
|
|
 |
|
 |
hi,
i'm getting the error that USE_SSL is no member of CSmtp.
whats wrong? i just copied it ...
thank you very much for answering
|
|
|
|
 |
|
 |
Shouldn't be a problem.
USE_SSL is a member of enum SMTP_SECURITY_TYPE in class CSmtp in CSmtp.h
I presume that you are using the latest (2.0) code?
What line is the error being reported at?
|
|
|
|
 |
|
 |
Talking rubbish...
Depends on which version you are using
1.9 and earlier USE_TLS is a member of class CSmtp
2.0 it is an enum in SMTP_SECURITY_TYPE (not within the class)
main.cpp is wrong for 2.0; it still has the class prefix (CSmtp: which will need to be removed.
|
|
|
|
 |
|
 |
I have been successfully compiled and used this library on Debian Linux amd64.
Patch is here
Regards,
Oleg Dolgov
|
|
|
|
 |
|
 |
Hello
I get this error when compiling:
'AF_INET' : undeclared identifier
I only get it on my stationary computer but not on my laptop.
Can anyone please help me solve this problem?
|
|
|
|
 |
|
 |
This error is show when the program is sending data and the internet connection is done or the connection not respond [slow connection].
then is show a error window and the program is closed.
The program doesn't detect this error, because the program is ended.
--Good code, is a wonder.
|
|
|
|
 |
|
 |
How can I send the text message from a file , same the attachments?.
I was trying to do that, but I need learn more, thanks.
Note:Sorry for my bad English.
|
|
|
|
 |
|
 |
Nice project.
I would like it if you could work on an x64 target too? I'd do it myself, but I think it'd be faster for you do to do it.
|
|
|
|
 |
|
 |
if the attachement is less than 4M, it goes well. but when the attachment is 5M+, it will crash. plz help!
|
|
|
|
 |
|
 |
I debug the csmtp code, and I find the problem.
// sending the file:
if(TotalSize/1024 > MSG_SIZE_IN_MB*1024)
throw ECSmtp(ECSmtp::MSG_TOO_BIG);
The MSG_SIZE_IN_MB is only 5, meaning that it can juse send an attachment less than 5M.
|
|
|
|
 |
|
 |
Hello!
I'm using the Makefile I got with the previous version of the project ( SMTP Client[^] )
makefile:
# Automatyczny makefile
CC = g++
CFLAGS = -Wall -O2 -DLINUX
ONLYCOMPILE = $(CC) $(CFLAGS) -c -g
OBJFILES := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
PROGNAME = CSmtp
all: $(PROGNAME)
$(PROGNAME) : $(OBJFILES)
$(CC) -o $(PROGNAME) $(OBJFILES)
%.o: %.cpp
${ONLYCOMPILE} -o $@ $<
clean:
rm *.o
While compiling I got the following problem:
g++ -Wall -O2 -DLINUX -c -g -o CSmtp.o CSmtp.cpp
In file included from CSmtp.cpp:43:0:
CSmtp.h:42:25: fatal error: openssl/ssl.h: No such file or directory
compilation terminated.
make: *** [CSmtp.o] Error 1
fatal error: openssl/ssl.h: No such file or directory
"openssl-0.9.8l\inc32" was already added to "Additional Include Directories" and "openssl-0.9.8l\out32" to "Additional Library Directories". This was done by the author i suppose?
Can someone help me with this problem plz?
Thank a lot!
|
|
|
|
 |