Problem with SendSMTPMail

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
mjolly
Posts: 2
Joined: Wed Aug 03 2005

Problem with SendSMTPMail

Post by mjolly »

I am having a problem using the SendSMTPMail function.

Here is my code:

Dim PDF As New CDIntfEx.CDIntfEx
Dim lRet As Long

lRet = PDF.SendSmtpMail("192.168.5.100", 25, "test@test1.co.uk", "test@test2.co.uk", "", "", "RW", "PDF", "C:\initial.pdf;monthly.pdf")

Note: I have actually used valid From and To email addresses.

When I run this code it raises this error:
-2147417848 - Method 'SendSmtpMail' of object 'ICDIntfEx' failed

I am developing against our own Merak Mail Server. The logs on this show that the communication reaches the following stage then stops with nothing else logged (again I have replaced the valid email with test@test2.co.uk)

192.168.5.160 [00000D08] Wed, 03 Aug 2005 15:57:27 +0100 >>> 250 2.1.5 <test@test2.co.uk>... Recipient ok
192.168.5.160 [00000D08] Wed, 03 Aug 2005 15:57:27 +0100 <<< DATA
192.168.5.160 [00000D08] Wed, 03 Aug 2005 15:57:27 +0100 >>> 354 Enter mail, end with "." on a line by itself

I am running using the developer evaluation version - although I don't call SetLicenseKey prior to calling the SendSmtpMail function. Is this correct?

Any ideas would be appreciated.

Matthew Jolly
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Which version of the PDF Converter are you using?

Please call SetLicenseKey before SendSmtpMail, but this may not be the cause of the issue you are facing.

If SendSmtpMail is still failing please let us know what is the return value lRet you are getting.
mjolly
Posts: 2
Joined: Wed Aug 03 2005

Post by mjolly »

Joan

Thanks for your response.

I am using version 2.50c

lRet does not return a value - the SendSmtpMail call causes a VB error to be raised. If I catch it the error is:

-2147417848 - Method 'SendSmtpMail' of object 'ICDIntfEx' failed

On further investigation I notice that this call, with the from paramter changed from test@test1.co.uk to test1.co.uk does not raise an error:

lRet = PDF.SendSmtpMail("192.168.5.100", 25, "test1.co.uk", "test@test2.co.uk", "", "", "RW", "PDF", "C:\initial.pdf;monthly.pdf")

Unfortunately my mail server sees this as an invalid from address, so the email still doesn't get sent. In this case the return value is -14.

I can probably change the settings on the mail server so that it accepts the message, but seeing as I will want to enter a valid from address this isn't exactly the answer.

Matt
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

The From parameter should be of the from "me@mysite.com", it shouldn't be of the form "mysite.com".

There was no known issues with the sending mail functions in version 2.50c, but you can try to use our latest 2.50d version just in case.

You can find version 2.50d online at www.amyuni.com
Post Reply