Welcome! Log In Create A New Profile

Advanced

Sending emails

Posted by Joel 
Joel
Sending emails
February 07, 2009 03:13PM
Hi All -

I have been trying to send emails through WebDev, have overcome several hurdles, now it says that it's working, but the emails never come through. I have tried a couple of different mail servers - same result. I'll paste the code I'm using here.

Note - I did contact LSI and my account is set up to send emails.
Note2 - my user account is mail@mafaofficemgr.com, password is 'password', mail server is mail.mafaofficemgr.com

Thanks!


//Start a SMTP session
EmailStartSMTPSession("test@mafaofficemgr.com", "password", "mail.mafaofficemgr.com")
IF ErrorOccurred THEN
Error(ErrorInfo(errSummary))
RETURN
END

//Reset the email variables
EmailReset()

//Sender of the message
Email.Sender="test@mafaofficemgr.com"

//Recipients of the message
Email.Recipient[1]="MasterWaldron@gmail.com"
Email.NbRecipient=1

//Attachments
Email.NbAttach=0


//Subject and content of message
Email.Subject="Test Subject"
Email.Message="Test Test Test"
Email.HTML=""

//Subject and content of message
EmailSendMessage("test@mafaofficemanager.com")
IF ErrorOccurred THEN
Error(ErrorInfo(errSummary))
END

//Close the SMTP session
EmailCloseSession("SessionSMTP")
Info("Your email was sent successfully")

// Routine to get email address
//HReadSeek(HFStudio,HFStudioID,1)

// If HFound(HFStudio) Then
// sSelEmail is String = HFStudio.Email
//Else
// Info("An Error has occurred")
//END

Arie
Re: Sending emails
February 07, 2009 04:26PM
Joel,
I did a test with your code, and used my own email-address as Recipient[1]

It gives me an error because the username in EmailStartSMTPSession() and EmailSendMessage() don't match.
But that gives an error as expected. Maybe you just typed wrong in this forum message?

After I changed EmailSendMessage("test@mafaofficemanager.com")
to EmailSendMessage("test@mafaofficemgr.com") is works fine!!

I'm getting the test-email.

Arie
Joel
Re: Sending emails
February 08, 2009 12:06AM
Arie -

Thank so much! I hate it when I don't catch those silly little mistakes!

You da best!

J
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: