How to send mail from harbour code

335 views
Skip to first unread message

Vikram Chhajer

unread,
Feb 4, 2020, 9:37:12 AM2/4/20
to Harbour Users
Hello Sir 

I need to know that how to send mail from harbour code , rightnow i am using send mail thru doscommand . i want to send mail with out having 3rd party software . using harbour 3.2 

Thanks 
Vikram
Message has been deleted

tarpauwatratar

unread,
Feb 4, 2020, 11:20:26 AM2/4/20
to Harbour Users

 cServer
-> Required. IP or domain name of the mail server
 nPort
-> Optional. Port used my email server
 cFrom
-> Required. Email address of the sender
 xTo
-> Required. Character string or array of email addresses to send
 the email to
 xCC
-> Optional. Character string or array of email addresses for
 CC
(Carbon Copy)
 xBCC
-> Optional. Character string or array of email addresses for
 BCC
(Blind Carbon Copy)
 cBody
-> Optional. The body message of the email as text, or the
 filename of the HTML message to send
.
 cSubject
-> Optional. Subject of the sending email
 aFiles
-> Optional. Array of attachments to the email to send
 cUser
-> Required. User name for the POP3 server
 cPass
-> Required. Password for cUser
 cPopServer
-> Required. POP3 server name or address
 nPriority
-> Optional. Email priority: 1=High, 3=Normal (Standard), 5=Low
 lRead
-> Optional. If set to .T., a confirmation request is send.
 
Standard setting is .F.
 xTrace
-> Optional. If set to .T., a log file is created (smtp-<n>.log).
 
Standard setting is .F.
 
If a block is passed, it will be called for each
 log
event with the message a string, no param on
 session close
.
 lPopAuth
-> Optional. Do POP3 authentication before sending mail.
 lNoAuth
-> Optional. Disable authentication methods
 nTimeOut
-> Optional. Number os ms to wait default 10000 (10s)
 cReplyTo
-> Optional.
 lSSL
-> Optional. Need SSL at connect time
 
(TLS need this param set to False)
 cSMTPPass
-> Optional.
 cCharset
-> Optional.
 cEncoding
-> Optional.
 cClientHost
-> Optional. Domain name of the SMTP client in the format
 smtp
.example.net OR client IP surrounded by brackets
 
as [127.0.0.1] for IPv4 or as [ipv6:address]
 
(e.g. '[ipv6:::1]') for IPv6
 
Note: This parameter is optional for backwards
 compatibility
, but should be provided to comply with RFC 2812.

 FUNCTION tip_MailSend( cServer, nPort, cFrom, xTo, xCC, xBCC, cBody, cSubject, ;
 aFiles
, cUser, cPass, cPopServer, nPriority, lRead, ;
 xTrace
, lPopAuth, lNoAuth, nTimeOut, cReplyTo, ;
 lSSL
, cSMTPPass, cCharset, cEncoding, cClientHost )




Vikram Chhajer

unread,
Feb 4, 2020, 12:26:11 PM2/4/20
to Harbour Users
Thanks 
But Can You share a prg  so can impliment the function easily  . 


Thanks 
Vikram

tarpauwatratar

unread,
Feb 4, 2020, 5:23:01 PM2/4/20
to Harbour Users
I can share only this file https://github.com/harbour/core/blob/068a923d6f9b2edebac5bfec9ced2334ac887223/contrib/hbtip/mailsend.prg

At now I'm unemployed and I don't have access to my mail-sender written for my ex-boss.
Reply all
Reply to author
Forward
0 new messages