Solved

Jmail Login

Posted on 2004-04-23
8
2,038 Views
Last Modified: 2012-05-04
Hello all,

I am using JMail to send emails.  I need to change the configuration to send the email from a different server.  I have the details of the server, but I dont know the syntax to state the login and password.

This is my existing code:

loMail = CREATEOBJECT("jmail.smtpmail")
loMail.serveraddress = <serveraddress>
loMail.sender = <senderaddress>
loMail.addRecipient("test@test.com")
loMail.subject = "This is a test"
loMail.Body = "This is a test"
loMail.Silent=.T.
lbRetVal = loMail.execute()
RELEASE loMail

I assume it would be something like:
loMail.ServerUserName = <username>
loMail.ServerPassword = <password>

But this does not work...

Please can anyone let me know the correct syntax for this.

Thanks
0
Comment
Question by:charlotte1
  • 4
  • 3
8 Comments
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900146
I dont think you need to use username and password, you should just have to allow relaying on the smpt server for the IP address your mail is coming from and you should be fine...
0
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900190
If you do need to use the username and password you can try this though:
loMail.MailServerUserName = "SomeUserName"
loMail.MailServerPassWord = "SomePassword"
0
 

Author Comment

by:charlotte1
ID: 10900289
I have tried this, but I get the error message "Unknown Member".

Unfortunately I do need to use a login and password as the mail server is not on our network, but it is an internet service.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900314
I think the login details are only available on the pro version, ie the one you pay for. Looks like you will have to open relays on the smtp server for your web server ip or fork out the cash for the object.
0
 

Author Comment

by:charlotte1
ID: 10900325
Please can you explain how I would do this.

Thanks
0
 

Author Comment

by:charlotte1
ID: 10900348
I mean, how I would open relays on the SMTP Server for our web server IP
0
 
LVL 11

Accepted Solution

by:
Slimshaneey earned 250 total points
ID: 10900388
In IIS, right click on your SMTP node, click properties. Go to the Access tab, and at the bottom click the Relay... Button. A pop up will appear, enter the ip address of your web server in the first box and bob's your uncle, you can send emails again...
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10900511
Why don't you just use CDOSYS instead of JMail, it's free and comes with Windows, and you can relay it off any SMTP servers that allow it.

CDO runs on Windows 2003, CDONTs does not.


Code below works, I use it: uses port 25, no configuration. Had problem with configuration on local machine.

strTo = "toemail@yourdomain.com"    'Make sure the From field has no spaces.
strFrom = "fromemail@yourdomain.com"
strSubject = "Your Subject"
strBody = "The content of email"


' Create an instance of the NewMail object.
Set objCDOMail = Server.CreateObject("CDO.Message")
   
' Set the properties of the object
objCDOMail.Sender = StrFrom
objCDOMail.To = strTo
objCDOMail.Subject = strSubject
objCDOMail.TextBody = strBody


' Some of the more useful ones I've included samples of here:
'objCDOMail.Cc = "mailto:sschofield@aspfree.com;steve@aspfree.com"   Notice this sending to more than one person!
'objCDOMail.Bcc = "sschofield@aspfree.com;steve@aspfree.com"
'objCDOMail.Importance = 1

'objCDOMail.AttachFile "c:\path\filename.txt", "filename.txt"

' Send the message!
objCDOMail.Send

' Set the object to nothing because it immediately becomes
' invalid after calling the Send method + it clears it out of the Server's Memory.
Set objCDOMail = Nothing
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question