BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to send email from application

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket)
View previous topic :: View next topic  
Author Message
Benjamin
Guest





PostPosted: Tue Aug 01, 2006 6:01 am    Post subject: How to send email from application Reply with quote



Hi i wanna send an email from my application, assuming that the user or me
does not have outlook setup etc. Also wondering how to authenticate if i was
to use smtp.google.com as host ? I duno.. plse help.

--
Simon
-----------------------------------------------------------------
msn : livestrings (AT) gmail (DOT) com
Back to top
Andrue Cope [TeamB]
Guest





PostPosted: Tue Aug 01, 2006 8:10 am    Post subject: Re: How to send email from application Reply with quote



Benjamin wrote:

Quote:
Hi i wanna send an email from my application, assuming that the user
or me does not have outlook setup etc. Also wondering how to
authenticate if i was to use smtp.google.com as host ? I duno.. plse
help.

Hope this helps:

AnsiString filePath=General_TemporaryFilePath()+".VRA";

sl->SaveToFile( filePath );

MapiMessage message;
memset( &message, 0, sizeof( message ) );

switch( MessageDlg( "For convenience a control file has been prepared
listing the viewers "
"you want assistance with. Do you want to email
this file now?",
mtConfirmation,
TMsgDlgButtons()<<mbYes<<mbNo<<mbCancel,
0 ) )
{
case mrYes:
{
message.lpszSubject="I need assistance";
message.lpszNoteText="Please open the link below using WindyE and
let me know what "
"conclusions you draw.";

MapiRecipDesc recipInfo;
memset( &recipInfo, 0, sizeof( recipInfo ) );
recipInfo.ulRecipClass=MAPI_ORIG;
recipInfo.lpszName="";
recipInfo.lpszAddress="";
message.lpOriginator=&recipInfo;

MapiFileDesc fileInfo;
memset( &fileInfo, 0, sizeof( fileInfo ) );
fileInfo.nPosition=0;
fileInfo.lpszPathName=filePath.c_str();
fileInfo.lpszFileName="Assistance request";
message.nFileCount=1;
message.lpFiles=&fileInfo;

MapiRecipDesc recipInfo2;
memset( &recipInfo2, 0, sizeof( recipInfo2 ) );
recipInfo2.ulRecipClass=MAPI_TO;
recipInfo2.lpszName="";
recipInfo2.lpszAddress="";

message.nRecipCount=1;
message.lpRecips=&recipInfo2;

break;
}

--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.