ورود

View Full Version : سوال: ارسال ایمیل تحت وب



mreza_adeli58
یک شنبه 06 بهمن 1387, 10:33 صبح
آیا امکانش هست که از طریق نرم افزار و تحت وب ایمیل ارسال کنیم ؟

binyaz2003
یک شنبه 06 بهمن 1387, 13:40 عصر
يک راه ساده :

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, STRING cAction, STRING cFileName, ;
STRING cParams, STRING cDir, INTEGER nShowWin

lcMail = "mailto:john@mycompany.com"+ ;
"?CC= boss@mycompany.com&Subject= Meet for lunch"+ ;
"&Body= Please join me for a sandwich at noon."
ShellExecute(0,"open",lcMail,"","",1)

با استفاده از اکتيوايکس Chilkat بگردي در سي دي هاي کامپوننت پيدا ميشه :


************************************************** *********
*** Chilkat SMTP: Send a single email without attachments
************************************************** *********

LOCAL loMailMan, loEmail, lnSuccess


************************************************** ******************
*!* object loMailman (ChilkatMailMan2) manages pop3 / smtp configuration
*!* and sending and receiving email
************************************************** ******************
*!* object loEMail (ChilkatEmail2) represents an email
************************************************** ******************


****************************
*!* configure smtp options
****************************
loMailman = CreateObject('Chilkat.MailMan2')
loMailman.UnlockComponent('unlock_code') && Unlocks the mailman object

*The hostname of the SMTP server used to send email
loMailman.SmtpHost = 'smtp.earthlink.net'

*The login for logging into the SMTP server. Use this only if your SMTP server requires authentication
*loMailman.SmtpUsername = 'my_username'
*loMailman.SmtpPassword = 'my_password'

*default: 25 -> The port number of the SMTP server used to send email.
*Only needs to be set if the SMTP server is running on a non-standard port
*loMailman.SmtpPort = 25

****************************
*!* create the email
****************************
loEmail = CreateObject("Chilkat.Email2")
loEmail.AddTo ( "Chilkat Support", "support@chilkatsoft.com") && Adds a recipient to the "to" list
loEmail.Subject = "Hello! This is a test email" && The subject of the email
loEmail.Body = "This is an email." && The body of the email
loEmail.FromName = 'Matt'
loEmail.FromAddress = "matt@chilkatsoft.com"

*Send an email. If mail was not successfully sent to any recipients, then an error is raised
lnSuccess = loMailman.SendEmail(loEmail)

*!* Nobody got the email: Function returns 0 and error is raised.
*!* Everybody got the email: Function returns 1.
*!* Some, but not everyone, got the email: Function returns 0, but error is not raised.

IF ( lnSuccess = 1 )
=MESSAGEBOX('The mail was sent succesfully',0+64,'Chilkat send email')
ELSE
=MESSAGEBOX(loMailman.LastErrorText)
ENDIF

************************************************** ****************************
* Releasing objects
************************************************** ****************************
RELEASE loMailman, loEmail

RETURN .T.
************************************************** ****************************

و http://fox.wikis.com/wc.dll?Wiki~SendSmtpEmail
البته کافيه در گوگل عبارت زير رو جستجو کنيد :
send email foxpro

mreza_adeli58
یک شنبه 13 بهمن 1387, 13:55 عصر
ممنون از راهنماییتون .
من از کد اولی استفاده کردم ولی 2 تا مشکل پیش اومد که اگه راهنمایی کنین ممنون میشم .
1 - چطور میشود که در چند سطر متن ایمیل را ارسال کرد ( چون هرکاری میکنم فقط در 1 سطر میفرسته )

2 - چطور میشه که دکمه سند را از اتوماتیک فشار داد و نیازی به زدن دکمه سند توسط کاربر نباشه .